I have a Kendo UI treeview which contains some node that i load children on expand by firing a ajax call and returning a data array. This works fine and i get the data and it binds to the tree.
However the issue occurs after the first expand of a node, when i expand the node first time the tree behaves correctly and everything is fine, however if i collapse and expand the node again the tree does not push the other nodes down and the expanded node overlaps all other icons in tree.
Here is the code that i use to build the tree
01.
$(
'#all-library-tree'
).kendoTreeView({
02.
loadOnDemand:
true
,
03.
dataSource: _masterTreeViewMasterObj.sort().reverse(),
04.
expand:
function
(e) {
05.
var
treeView = $(
'#all-library-tree'
).data(
'kendoTreeView'
);
06.
var
dataItem = treeView.dataItem(e.node);
07.
dataItem.load();
08.
09.
if
(dataItem.children.data().length !== 0)
return
;
10.
11.
12.
if
(dataItem.id === -1) {
13.
//get unused data
14.
GetUnUsedChildrenForRHSTree(dataItem.text, dataItem.children);
15.
}
16.
17.
}
18.
});