Hi, i was trying to develop a client side script that should check all nodes if the "Select All" checkbox is checked.
The nodes are still not checked after this script being executed in the NodeChecking event handler.
<igtree:WebDataTree ID="wdtProcesses" runat="server" CssClass="ProcessesWebTree" EnableAjax="true" AjaxIndicator-Enabled="True" DragDropSettings-EnableDragDrop="false" NodeEditing-Enabled="false" CheckBoxMode="BiState"> <Nodes> </Nodes> <NodeSettings CssClass="ProcessExplorerNodeStyle" HoverCssClass="ProcessExplorerHoverNodeStyle" SelectedCssClass="ProcessExplorerSelectedNodeStyle" /> <ClientEvents NodeChecking="NodeCheckedBoxHandler" /> </igtree:WebDataTree>
function NodeCheckedBoxHandler(sender, args) {
var node = args.getNode(); var wdt = $find("<%=wdtProcesses.ClientID %>");
if (node.get_text() == 'Select All') {
for (var i = 0; i < wdt.getNodes().get_length(); i++) {
var rootNode = wdt.getNodes().getNode(i); rootNode.set_selected = true;
} } }
Hello,
Rather than using set_selected you should use set_checkState. As a note, both of these are functions so you should be passing a value in rather than setting it equal to some value. For set_checkState it accepts a value of 0 for unchecked and a value of 1 for checked. Your modified code would look something like the following:
Please let me know if you have any questions or concerns about this implementation.