javascriptkendo-ui-mvckendo-treelist

Kendo TreeList: expanded should stay expanded for user experience


I have a Kendo TreeList and can edit each item. After editing, I do

treeList.dataSource.read();

This causes every item to collapse (because the default .expand is false).

But I want that everything (items expanded by the user, items not expanded) stays the same, just the edited item/row should change in the view.


Solution

  • This solved my issue :

    https://www.telerik.com/forums/restoring-treelist-expanded-state-after-refresh

    I had to save the expanded state and restore it every time I call treeList.dataSource.read().

    Therefore, I used an onDataBinding method to save and an onDataBound method to restore.