Hello,
I need to be able to clear out all checkboxes in my treeview via javascript. I tried guessing on what the function might be:
var control = $find('<%=selectuser.ClientID %>');checkedItems = control.get_checkedNodes();for (var i = 0; i < checkedItems.length; i++) { checkedItems[i].set_checkState() = 0;}
but this didn't work as the items still displayed a check in the checkbox. Can I please be given the syntax to clearing out all checkboxes on clientside?
Thanks.
Hello Shane,
Thank you for posting in the community.
As set_checkState is a function the desired state value should be passed as a parameter to it.
Please note that after unchecking a node, the checked nodes collection of the tree would also be automatically updated. Below is a sample function for deselecting all tree nodes:
Hope this helps.
Please feel free to contact me if you are still experiencing any issues with this scenario.
Hi Peter,
I am trying to set the selected node of webdatatree using javascript. Which is parentnode. It
return with undefined.
Neither TopCurrentNode.get_parentNode().set_selected(true) nor TopRptTree.set_activeNode(TopCurrentNode.get_parentNode()) works
here is the function
function WebTabSelectedIndexChange(sender, e) {
var webTab = ig_controls.ReportTab;
var selectedIndex = webTab.get_selectedIndex();
var selectedTab = webTab.get_tabs()[selectedIndex];
if (selectedIndex == 0) {
var TopRptTree = parent.frames[0].$find('TopReportTree');
var TopCurrentNode = TopRptTree.get_selectedNodes()[0];
if (TopCurrentNode && TopCurrentNode.get_parentNode()) {
TopCurrentNode.get_parentNode().set_selected(true)
}
Thanks
Arshi