My tree is defined as:
<ignav:UltraWebTree ID="OrganizationalUnitTree" WebTreeTarget="HierarchicalTree" CheckBoxes="true" runat="server"> <ClientSideEvents NodeChecked="TreeNodeChecked" /></ignav:UltraWebTree>
And the script is:
function TreeNodeChecked(treeId, nodeId, bChecked){ var selectedNode = igtree_getNodeById(nodeId); var childNodes = selectedNode.getChildNodes();
if (bChecked) { for (n in childNodes) { childNodes.setChecked(bChecked); } }}
Shouldnt this get an event when I uncheck a checkbox? Whenever I uncheck a checkbox, I want all the children unchecked as well.
um,,i am new on ultrawebtree infragistics,,and have same problem as you,,
i've already put the same script as you,,but it didn't work,,,
it's said igtree_getNodeById not found
how can i fixed it?
thanks
:)
I am not sure what the icon is for or if it is a typo but the index should be used within the "childNodes" object as it iterates through the collection.
Use below code, it works fine.
if (bChecked) { selectedNode.setChecked(true) ;//this is for root node
for (n in childNodes) { childNodes.setChecked(true); } }
else
{
selectedNode.setChecked(false)
for (n in childNodes) { childNodes.setChecked(false); } }}
Ofcourse - I'm apparently an idiot! :)
Thanks! :D
I am by no means a WebTree expert, but you have
if (bChecked) {
}
Wouldn't bChecked be false when you uncheck, thereby skipping over the code in question.