I have a requirement that to load child data from database every time i clicked on expand icon but right now its only load data on first time of expand button but I need it on every click.
2 Answers, 1 is accepted
0
Aleksandar
Telerik team
answered on 13 Aug 2020, 06:23 AM
Hello Harpreet,
To achieve the desired result you can attach an event handler function to the collapse event.
.Events(ev=>ev.Collapse("onCollapse"))
In the handler function get a reference to the collapsed dataItem and set its loaded flag to false. This way the next time the expand icon is clicked a request to the remote endpoint will be made:
functiononCollapse(e){
var dataItem = e.sender.dataItem(e.node);
dataItem.loaded(false);
}
This is a sample dojo demonstrating the above approach.