We have a dhtmlxtree with about 5000 nodes, checkbox enabled. If we have enableSmartXMLParsing(true), after the page is loaded, if user select any node checkbox then the script tries to call setCheck() for selecting the other dependent other 100 nodes. This always show stop script error on IE. If we disable the SmartXMLParsing, it takes long time to load the tree, but, no problem calling 100 times of setCheck() after the tree is loaded.
How i can fixed this issue i want tree to load fast in 5-6 sec first time and on selection of any node,check all dependent node with IE stop script error.
treeTags = new dhtmlXTreeObject(“divTagTreeInner”, “100%”, “100%”, 0);
treeTags.setSkin(‘dhx_skyblack’);
treeTags.setImagePath(“Scripts/dhtmlxTree/dhtmlxTree/codebase/imgs/csh_bluebooks/”);
treeTags.enableSmartXMLParsing(true)
treeTags.enableThreeStateCheckboxes(false);
treeTags.enableTreeImages(true);
treeTags.enableCheckBoxes(true);
treeTags.enableTreeLines(false);
treeTags.enableAutoTooltips(1);
treeTags.attachEvent(“onCheck”, “TreeCheckFunction”);
treeTags.setOnOpenHandler(tonopen);
treeTags.attachEvent(“onClick”, function (id, state)
treeTags.attachEvent(“onXLE”, function (treeTags, id)
//loading the tree data from xml
treeTags.loadXMLString(treeXmlDataSorce);
Please let us know if there is any way to fix it. its rellay help us.
We’ve check your code snippet - locally everything ok.
Please, provide us your onCheck handler function. It can be the reason of the issue.
The whole html file will be fine.
function TreeCheckFunction(id, state) {
var checkBoxs = treeTags.getAllUnchecked(0);
var zz = checkBoxs.split(','); //here we get 200 CSv node value
for(var i=0;i<zz.length;i++)
{
var imge = "<a href=\"javascript:TreeCheckFunction('" + zz[i] + "',false);\"> <img title='Delete Module' alt='Delete Module' src=\"images/document_delete.png\" /></a>";
var count = mygrid.getRowsNum();
mygrid.addRow(zz[i], [imge, "", "", tree.getItemText(zz[i])], count);
tree.setCheck(zz[i], true);
treeTags.setCheck(zz[i], true);
}
In our code we need to allow the enableSmartXMLParsing(true) ,otherwise its not loaded the tree well formatted if tree has a child with two different parent.
Please let us know if there is any way to fix it. its rellay help us.
Calling methods that change items state causes parsing and rendering of these items ( setItemText, setCheck methods). So, if you call setCheck for almost all items, you will face performance issue.
In case of enabled 3-state checkboxes mode, tree changes state of checkboxes without parsing and rendering of changed items. So, you can temporary enable 3-state checkboxes and disable after checking all the items - you will probably solve the issue:
[code]function TreeCheckFunction(id, state) {
var checkBoxs = treeTags.getAllUnchecked(0);
var zz = checkBoxs.split(’,’); //here we get 200 CSv node value
for(var i=0;i<zz.length;i++)
{
var imge = “<a href=“javascript:TreeCheckFunction(’” + zz[i] + “’,false);”> <img title=‘Delete Module’ alt=‘Delete Module’ src=“images/document_delete.png” />”;
var count = mygrid.getRowsNum();
mygrid.addRow(zz[i], [imge, “”, “”, tree.getItemText(zz[i])], count);
}
tree.enableThreeStateCheckboxes(1);
treeTags.enableThreeStateCheckboxes(1);
var ids = tree.getSubItems(0);
var arr = ids.split(",");
for(var i =0;i < arr.length;i++){
tree.setCheck(arr[i],true);
treeTags.setCheck(arr[i], true);
}
tree.enableThreeStateCheckboxes(0);
treeTags.enableThreeStateCheckboxes(0);
}[/code]
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan