This is a migrated thread and some comments may be shown as answers.

Webservice Load On Demand still show expand/collapse icon for nodes with no children

8 Answers 104 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jacky Chau
Top achievements
Rank 1
Jacky Chau asked on 16 Oct 2008, 11:16 PM
I am loading child nodes using webservice.  If there are no child nodes, I want the expand/collapse icon to go away.  I tried setting the expand_mode to clientside during the client onTreePopulated event but that didn't do anything.  Is there a way to refresh the state of the node?

8 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 17 Oct 2008, 02:19 PM
Hello Jacky Chau,

We will try to fix that problem.

In the meantime I suggest that you set the ExpandMode to ClientSide in the WebService method.

I have updated your Telerik Points for finding the problem.

All the best,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jacky Chau
Top achievements
Rank 1
answered on 17 Oct 2008, 02:33 PM
I dont see how setting the ExpandMode to ClientSide in the WebService method will do anything.  I want the icon to refresh for the node that is being expanded.  For example, I am expanding nodeA and nodeA has no child nodes.  I want the expand/collapse icon for nodeA to now go away.
0
Veselin Vasilev
Telerik team
answered on 17 Oct 2008, 03:04 PM
Hi Jacky Chau,

I did not understand that you wanted to hide the expand/collapse icon next to the parent node. Actually, if no child nodes are added to the expanded node - this icon will automatically disappear.

Greetings,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jacky Chau
Top achievements
Rank 1
answered on 17 Oct 2008, 03:21 PM
That's not the behavior I am seeing.  On nodeA expand, it hits a webservice to retrieve childnodes.  If no childnodes are returned, it doesn't remove the expand/collapse icon for nodeA.
0
Veselin Vasilev
Telerik team
answered on 17 Oct 2008, 03:28 PM
Hello Jacky Chau,

Then I believe the best way to proceed is to send us a sample project in a new support ticket. We will test it locally and find a working solution for you.

Kind regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mirac
Top achievements
Rank 1
answered on 22 Sep 2009, 02:04 PM
Hi,

I am experiencing (if not the same) a similar problem.

I build the tree manually from custom business objects and have the node expand mode set to serverside. The tree is completely built on the first page load, but I need the click event/postback when nodes are selected. It wonders me that the expand/collapse images are shown for leaf nodes. I do not need to load nodes dynamically, I just need the select event.

I guess the problem is that the leaf nodes thinks they should load child nodes dynamically when clicked? Is there any way to change this behaviour?
0
Atanas Korchev
Telerik team
answered on 25 Sep 2009, 07:59 AM
Hello Mirac,

This is controlled by the ExpandMode property of the nodes. If it is set to ServerSide ServerSideCallback or WebService the node will display the expand image. If it is set to ClientSide (the default value) it will display the expand image only if it has child nodes.

I hope this helps,
Albert,
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mirac
Top achievements
Rank 1
answered on 29 Sep 2009, 08:43 AM
Thanks for your reply. I understand that this is the intended behaviour. It would just be nice to have a "HasChildNodes" or something property to indicate whether the expand/collapse images should be shown or not.
Tags
TreeView
Asked by
Jacky Chau
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Jacky Chau
Top achievements
Rank 1
Mirac
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or