Inside of the TreeList's collapse event handler I put the line e.model.loaded(false); to force the TreeList widget to reload the nodes every time it expands. It doesn't work properly though and it prevents the TreeList from collapsing the node.
3 Answers, 1 is accepted
0
Hello, Matthew,
The issue occurs because the event is preventable, and the loaded method has to be called inside a setTimeout method.
Still, please have in mind that this will create a scenario where the TreeList dataSource will think that this model is not loaded and request and append it again. This will create duplicate DOM elements in the TreeList:
If the data has to be reloaded, please call the read method of the dataSource to reload the data:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-read
Regards,
Stefan
Progress Telerik
The issue occurs because the event is preventable, and the loaded method has to be called inside a setTimeout method.
Still, please have in mind that this will create a scenario where the TreeList dataSource will think that this model is not loaded and request and append it again. This will create duplicate DOM elements in the TreeList:
collapse:
function
(e) {
setTimeout(
function
(){
e.model.loaded(
false
);
})
},
If the data has to be reloaded, please call the read method of the dataSource to reload the data:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-read
Regards,
Stefan
Progress Telerik
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.
0

Matthew
Top achievements
Rank 1
answered on 21 Sep 2017, 05:29 PM
Thanks! This works. But it seems to collapse all the rows when I collapse one row and call the datasource read method. Is there a way to do this that doesn't refresh the whole treelist view?
[quote]Stefan said:Hello, Matthew,
The issue occurs because the event is preventable, and the loaded method has to be called inside a setTimeout method.
Still, please have in mind that this will create a scenario where the TreeList dataSource will think that this model is not loaded and request and append it again. This will create duplicate DOM elements in the TreeList:
collapse:
function
(e) {
setTimeout(
function
(){
e.model.loaded(
false
);
})
},
If the data has to be reloaded, please call the read method of the dataSource to reload the data:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-read
Regards,
Stefan
Progress Telerik
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.
[/quote]0
Hello, Matthew,
As the issue seems to be on our end based on the documentation. We will check if the scenario is no longer supported or this is an issue with the current version of the control.
As the same topic is in another forum post, I will add the answer there to avoid duplicates:
http://www.telerik.com/forums/treelist-reload-node-on-expand
Thank you in advance for the patience.
Regards,
Stefan
Progress Telerik
As the issue seems to be on our end based on the documentation. We will check if the scenario is no longer supported or this is an issue with the current version of the control.
As the same topic is in another forum post, I will add the answer there to avoid duplicates:
http://www.telerik.com/forums/treelist-reload-node-on-expand
Thank you in advance for the patience.
Regards,
Stefan
Progress Telerik
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.