Expanding all was just an example. We have a lot of data and I cannot load the data for the whole tree in the beginning. This is why each branch should open with ajax request. My idea is that when user opens a branch, next time he refreshes the page the branches and subbranches he previously opened to be expanded. This is why I would keep all opened items ids in the localStorage
var expanded = localStorage["expandedIds"].split(","); //or something like this
And then comes
requestEnd : function (e) {
$.each(e.response, function(){
if($.inArray(this, expanded) > -1)this.expanded = true;
});
}
But this seems not to be working out of the box. It seems that my JSONP should already contain the expanded branches. There is no other way right?
0
Alex Gyoshev
Telerik team
answered on 01 Oct 2015, 08:13 AM
Hello Ivo,
This approach will work if the children of the expanded items are loaded from the server, as shown in this Dojo snippet.
Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!