How to add checkbox or any other HTML elements
html = "<input type='checkbox' class='chk' id='chk_123' name='chk_123'> My checkbox here"
oTree.Add(ParentId, Id, html)
How to make checkbox smaller using CSS
input.chk {height:13px; width:13px; margin:0px;}
How to check/uncheck all children checkboxes
Add function ob_t2c(this).
Example
html= "<input type='checkbox' class='chk' onclick='ob_t2c(this)'> My checkbox here"
How to check/uncheck all checkboxes from the TreeView
Add function ob_t2_SelectCheckboxes to the ob_tree_xxxx.js file.
Example
<input type="button" id="Button1" value="Check All" onclick="ob_t2_SelectCheckboxes(true)" />
<input type="button" id="Button2" value="Uncheck All" onclick="ob_t2_SelectCheckboxes(false)" />
How to make checkbox checked
Use HTML attribute CHECKED. Example
html = "<input type='checkbox' CHECKED id=.....
How to send all selected checkboxes to server
You can send to server ob_t2_list_checked() using any method you like.
We recommend to use our AJAXPage control.
You can post list of IDs checked checkboxes to server, process them on server
and return result WITHOUT reloading page.
<input type="button" value="Send" id=btnSend onclick=
"ob_post.AddParam("list_ids_checked", ob_t2_list_checked());
ob_post.post("processing_page.aspx", "your_event_name");">
Example how to show it in textbox
<input type="button" value="Send" id=btnSend onclick=
"document.getElementById('txtSend').value=ob_t2_list_checked()">
NOTE 1: Give ID to checkboxes starting with 'chk_'. Example 'chk_' + NodeId
NOTE 2: You can also edit function ob_t2_list_checked() for your project.
See JavaScript in folder \tree2\Script\ob_tree_XXX.js
How to disable selecting/highlighting nodes on click
oTree.SelectedEnable = false
| |