I use the ultrawebtree with checkbox, Now I want to popup a message with javascript (for example:BLOCKED SCRIPTalert("hello world!");) when I click the checkbox before the ultrawebtree,So I want to get your help, please give me some example code.Thanks!
Hi,
From my understanding, you want to alert whenever a checkbox is checked using JavaScript...to achieve this, you can use the 'NodeChecked' clientside event of the UltraWebTree. Here is a sample code snippet which shows how to alert whenever a checkbox is checked or unchecked:
if (bChecked == true)
else
}
I'm using CSOM to modify the checked nodes in a UltraWebTree, after the user checks one of them.
The example above helped to get me started - and I can verify that I am indeed calling
node.setChecked = false;
for several nodes in my tree.
What I expected to happen is the checkboxes would be cleared in the browser window - but this is not the case... Do I need to set any UltraWebTree properties in order to enable client-side changes to the checkboxes?
Here is my javascript - MEWebTree_NodeChecked is called whenever any node gets checked, I un-check all nodes that are at a different level.
function MEWebTree_ClearOtherLevels(node, newLevel) { var level = node.getLevel(); if (level != newLevel) { alert("clearing node " + node.Id); node.setChecked = false; } if (node.hasChildren) { var nodes = node.getChildNodes(); if (nodes != null) { var i = 0; for (i = 0; i < nodes.length; i++) { MEWebTree_ClearOtherLevels(nodes[i], newLevel); } } } } function MEWebTree_NodeChecked(treeId, nodeId, bChecked) { if (bChecked == true) { //take action on each check var node = igtree_getNodeById(nodeId); if (node != null) { var nodeLevel = node.getLevel(); alert(nodeId + " Level- " + nodeLevel + " Node Checked"); // clear any checks at other levels var tree = igtree_getTreeById(treeId); if (tree != null) { var treeNodes = tree.getNodes(); if (treeNodes != null) { var i = 0; for (i = 0; i < treeNodes.length; i++) { MEWebTree_ClearOtherLevels(treeNodes[i], nodeLevel); } } } } } }
Figured it out, using other examples on this community site...
My error was in trying to use this: node.setChecked = false;
when what I needed was this: node.setChecked(false);
Hello?
Anyone out there help me figure this out?
I haven't previously used client-side features of IG controls - but this one seems obvious --
I programatically set the checked state of several nodes in my UltraWebtrree using CSOM, but they do not appear checked.
What am I leaving out? is there a function call to redraw the tree????
Thanks in advance!
Mike