Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by abhishek on Aug 31, 2009 00:17
open dhtmlx forum
how to enable multiple select option in dhtmlx tree?

1. how to enable multiple select option in dhtmlx tree?

2.
I have created a DHTMLX Tree with checkbox, how to select a node when a checkbox is checked?

i didnot see any method like setSelectedItem()...... i have tried focusItem(itemid) it didnot worked

3.
How to associate a control key with the tree?

4.
I have serialised the tree to json file, and is modified the json file adding check="1" for a particular node, but it didnot reflected in the tree. i.e. the node checkbox is not checked in the tree.


Answer posted by Alex (support) on Aug 31, 2009 03:19

>> how to enable multiple select option in dhtmlx tree?

tree.enableMultiselection(true)

In PRO edition only

>> I have created a DHTMLX Tree with checkbox, how to select a node when a checkbox is checked?

There is selectItem method:

tree.attachEvent("onCheck",function(id,state){

if(state) tree.selectItem(id)

return true

}) 

>> How to associate a control key with the tree?

If keyboard navigation isn't enabled, tree doesn't set key press event handlers.

You should use own method in this case. 

>> I have serialised the tree to json file, and is modified the json file adding check="1" for a particular node, but it didnot reflected in the tree. i.e. the node checkbox is not checked in the tree

Check state can be set as follows:

{...,item:[{id:"item id",text:"item text",checked:"1"}],...}