Hi,
I need to loop through the WebDataTree in JavaScript and get a list of all "selected" checkboxes. I tried the below code. But it works only for the first entry in the loop.
for (var i=0; i < len; i++)
{
var node = nodes.getNode(i);
m_strResult = m_strResult + node.get_text();
var objChkBox = node._checkBox;
m_strResult = m_strResult + " : " + node.get_selected() + "\n";
}
Here objChkBox is null from the second node in the tree.
Also from the objChkBox object how do I know if the checkbox is selected?
Please let me know what I am missing.
Thanks
Prasad
you can get all the checked nodes in the tree by calling tree.get_checkedNodes(). It will return an array of $IG.Node objects.Then on each node you can call node.get_checkState() which can return 0-Unchecked, 1-Checked, 2-Partial depending on the check box mode you have configured.
Hope this helps.
Thanks,
Lubomir
I´m using tree.CheckedNodes (in C# ) and it works just fine.
Never the less i was wondering if it is possible to get only all checked nodes of a certain level? For example, get all checked nodes in level 2.
And one other question, is it possible to have checkboxes only in level 2 and NOT on level 0 and level 1?
Thanks in advance,
Samuel Jesus