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

synchronous client expand function;

3 Answers 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ben Turpin
Top achievements
Rank 1
Ben Turpin asked on 30 Sep 2008, 08:55 PM
Hello.

I need to find a way to select a child node in a LoadOnDemand node.

I do a call to the server that returns me the full hierarchical path where the node is in the treeview. It actually returns me the ids of the nodes.
The problem is that the node is a LoadOnDemand node, in other words, I have to wait this node to load before I can actually select any child node and there might be a lot of subnodes.

For example:

I receive a message like this: "menuId=01|menuItem=22|menuItem=33"

The '01' node is one of the root nodes, so I can easily find it and expand it. Now I have to find a way to wait until the LoadOnDemand finishes loading up all nodes, expand the '22' menuItemchild node , wait the ajax call to finish again, so I can finally select the '33' menuitem.

Is there any way select a node inside a bunch of LoadOnDemandNode?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Oct 2008, 07:02 AM
Hello Ben Turpin,

You can use the OnClientNodePopulated event which is fired after load on demand.

Greetings,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ben Turpin
Top achievements
Rank 1
answered on 01 Oct 2008, 04:19 PM
Hi Albert, Thanks for the reply.

Im afraid that the problem is a bit more complicated. The tree im using here is set EnableViewState off and im using client radajax manager to do some ajax calls fulfill the operations without postback.

Imagine like this.
There are 2 trees ( A and B)

Tree A has some menuitems that references some nodes in tree B.
When the user selects a node and clicks the reference option from the menucontext, then it should exapand the tree B nodes, that has the desired node, recursively until it finds the proper referenced node to paint.
With that comes the LoadOnDemand problem. Imagine a 10 level depth node tree, it would take quite some time to LoadOnDemand every node in the hierarchy above the painted node.

I was willing to know if there were a quicker approach, like loading up all the childs and subchilds at once till the desired node.

Thanks.





0
Atanas Korchev
Telerik team
answered on 01 Oct 2008, 04:26 PM
Hello Ben Turpin,

No, there is no way to populate all load on demand nodes at once. However you can create a hierarchy of nodes during the first load on demand request and populate all required nodes at once.

Best wishes,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Ben Turpin
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ben Turpin
Top achievements
Rank 1
Share this question
or