synchronous client expand function;

4 posts, 0 answers
  1. Ben Turpin
    Ben Turpin avatar
    27 posts
    Member since:
    Jun 2008

    Posted 30 Sep 2008 Link to this post

    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!

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 01 Oct 2008 Link to this post

    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.
  3. Ben Turpin
    Ben Turpin avatar
    27 posts
    Member since:
    Jun 2008

    Posted 01 Oct 2008 Link to this post

    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.





  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 01 Oct 2008 Link to this post

    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.
Back to Top