Hello Folks
looking for some client-side code to uncheck all nodes from tree2 when tree1 node is checked, and vise-versa. I use the function treeNewRole_NodeClick(treeId, nodeId) - to apply some other actions when the client clicks on the node.
Thanks,
gentis
Hello Bhadresh
Thank you for the quick response. I tried this piece of code, but I cant seem to get the seconds WebTree2 Id inside the NodeClick for WebTree1
I used both
var tree2Id = igtree_getTreeById("UltraWebTree2");
var
tree2Id = igtree_getTreeById("<%= UltraWebTree2.ClientID %>")
I used both I;m getting tree2Id = undefined or null therefore i cant grab the nodes.
Would you have any other insights
Thanks
Hi gentis,
Thanks for the details. You can handle the client side NodeClick event to select/unselect all nodes in the tree.
Here is JavaScript which demonstrates this:
function NodeClick(treeId, nodeId) { var tree = igtree_getTreeById("UltraWebTree2"); //target tree called from source tree var node = tree.getNodes(true); for (var index = 0; index < node.length; index++) { node[index].setSelected(false); } }
Bhadresh
On a closer look at the NodeChecked functionality, I do not have checkboxes in the WebTree. I might have confused you. I simple want the selected node style to return to un selected style.
The selected style is as follows:
<
SelectedNodeStyle BackColor="#316AC5" ForeColor="White">
<Padding Bottom="2px" Left="2px" Right="2px" Top="2px" />
</SelectedNodeStyle>
This doesn't seem to work for me. I have included NodeChecked in the
<ClientSideEvents InitializeTree="treeRoles_InitializeTree" NodeClick="treeRoles_NodeClick" NodeChecked="treeRoles_NodeChecked" />
treeRoles_NodeChecked for me, but the function is not being hit at all, when clicking different nodes.
Hi,
You can handle client side NodeChecked event to uncheck all nodes of the tree1 when tree2 node is checked.
function NodeChecked(treeId, nodeId, bChecked) { var tree=igtree_getTreeById("UltraWebTree1");//target tree called from source tree var node=tree.getNodes(); for(var index=0;index<node.length;index++) { node[index].setChecked(false); } }
Let me know if I may be of a further assistance.