What is the best and most efficient way to expand and collapse all nodes for a given TreeList? I'm currently using the following code where fp-grid is the root div element of my kendoTreeList. It works. But it's very slow! Is there a better and more efficient way to do this?
var
treeList = jQuery(
'#fp-grid'
).data(
"kendoTreeList"
);
if
(treeList) {
jQuery(
'#fp-grid tbody>tr'
).each(
function
(index) {
if
(treeExpand) {
treeList.expand(jQuery(
this
));
}
else
{
treeList.collapse(jQuery(
this
));
}
});
}