I have a TreeGrid (2.5) with rather big trees, up to 30k Records, with paging and smartxmlparsing enabled.
Each record has a checkbox at the first column.
Requirement is: when checking the checkbox at a parent node, all children nodes need to be checked as well.
What i’m doing now is looping through all children of the node (using getAllSubItems) and set the value like this: vTreeGrid.cells(vCheckedChilds[i],0).setValue(1);
This works as expected, but it is way too slow, especially when the tree isn’t fully parsed yet.
// if check row has childs we have to check them as well
var vCheckedChilds = vTreeGrid.getAllSubItems(pRowId).split(",");
if (vCheckedChilds[0]!="")
{
//console.time("loop Children");
var vCheckedChildsLength = vCheckedChilds.length;
for(var i=0; i<vCheckedChildsLength; i++)
{
if (pState == true)
{
vTreeGrid.cells(vCheckedChilds[i],0).setValue(1);
gCheckboxArray[vCheckedChilds[i]] = vCheckedChilds[i];
}
else
{
vTreeGrid.cells(vCheckedChilds[i],0).setValue(0);
gCheckboxArray[vCheckedChilds[i]] = "";
}
}
}
With 2000 records it takes about 15sec, which is way too slow.
With 30k records it takes even longer (no surprise here).
The fastest way is to update rows on the server side, remove all rows from treeGrid and load the again.
Check example here dhtmlx.com/docs/products/dht … fresh.html
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan