Load on demand with refresh of node without affecting children already loaded

2 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Mar 2011

    Posted 25 Apr 2017 Link to this post

    The treeview is currently configured to load on demand.

    Scenario is this I need to be able to refresh a node (ask database) due to one of the following actions from a user:

     

    1. Adding of a new node under currently selected item.
    2. Deleting of a node that is the currently selected item.
    3. Updating the name of the currently selected item.

     

    I have this working however if the selected node is expanded and all nodes below are expanded also - the state of the branch up to the selected node is retained but the nodes past the selected node are now collapsed after a reload of the selected node. (In the case of the delete - I refresh the parent node).

     

    Is there a way to maintain the state of the branches so that a refresh does not collapse the branch below the refresh point?

     

    If my description is insufficient I can explain with a more specific scenario and include screen shots.

  2. Nencho
    Admin
    Nencho avatar
    1871 posts

    Posted 27 Apr 2017 Link to this post

    Hello David,

    Indeed the experienced behavior is expected, due to the binding scenario that you have ant the updates of the node. You can, however, try to implement the approach demonstrated in the following documentation article. 

    http://docs.telerik.com/kendo-ui/controls/navigation/treeview/how-to/integration/persist-expanded-state


    The article demonstrates how to store the expanded nodes in the Cookies and then restore them. Since you use load on demand at your end, you would need to use the load method on the item that needs to be expanded. Consider the below exemplary implementation:

    http://dojo.telerik.com/@nenchef/iGoHi/9


    Regards,
    Nencho
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top