How to select multiple nodes?
One line of code can do it
oTree.MultiSelectEnable = true
How do I get an array with all the elements selected?
Variable ob_sn2 has selected node IDs separated by "|" symbol.
You can send data to server, process data on server without reloading page using AJAXPage.
ob_sn2.split('|') returns an array with the ids of the selected elements.
How do I get the selected ids at server side?
Add to your page a hidden element:
<input type='hidden' name='ob_selected_ids' id='ob_selected_ids' value=''>
And on the button that submits the page add:
onClick='document.getElementById("ob_selected_ids").value = ob_sn2; return true;'
Now on the server side, simply read the value from the field ob_selected_ids
and split it using | as separator
You can also use our free AJAXPage ASP.NET control
It can send data to server, process data on server and send result back without reloading page.
How do I select nodes using SHIFT+Click?
To enable this feature you have to do the following:
| - |
|
Download the new ob_multiselect function and replace the old one
|
located in the ob_mdn_xxxx.js file (from the tree2/script folder)
- Add a new variable at the top of the ob_mdn_xxxx.js file:
var o_l2;
| - |
|
Download the new ob_t2_UnselectAllNodes function and add it at the end
|
of the ob_tree_xxxx.js file
How to select several nodes on server side?
oTree.MultiSelectEnable = true;
oTree.SelectedId = "node1,node2,node3,node4";
List node IDs with a comma (",") and without spaces.
| |