Giving errer UnCheckBranch - dhtmlxTree

Hi, When i click on UnCheck Branch in dhtmlxTree i’m getting belwo given java script errer. please i need your help.



sNode has no properties

setSubChecked(“”, false)dhtmlxtree.js (line 127)

onclick(click clientX=29, clientY=8)tripsTraining.htm… (line 1)

[Break on this error] for (var i=0;i<sNode.parentObject.childsCount;i++)this._setCheck(sNode.parentOb…



i added this script:

UnCheck branch

In your case, problem caused by not-selected element in tree, in such case tree.getSelectedItemId() returns empty value and result function throws error, just add check as

onClick=“if (tree.getSelectedItemId()) tree.setSubChecked(tree.getSelectedItemId(),false);”