Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Feb 21, 2008 07:56
open dhtmlx forum
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:
<a href="javascript:void(0);" onClick="tree.setSubChecked(tree.getSelectedItemId(),false);">UnCheck branch</a>
Answer posted by Support on Feb 21, 2008 09:33
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);"