Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jonathan on Feb 27, 2008 23:49
open dhtmlx forum
dhtmlxTreeGrid

Hello,
I'm interested at buying the dhtmlxTreeGrid component, and i have a question.
is it possible to set a checkbox right next to the icons in the tree (or instead) just like in this example of the dhtmlx tree (which is a great component)
http://www.dhtmlx.com/docs/products/dhtmlxTree/samples/checkboxes/tree_checkboxes.html?un=1204184698000

and allso keeping the functionality (knowing which items are selected and also to catch the event and stuff like this)

thanks in advance.
Answer posted by Support on Feb 28, 2008 02:13
In TreeGrid component, tree cell can't contain a checkbox itself, but it is a grid, so you can add a column with checkbox after, or before tree column

    tree.setColTypes("ch","tree",....

The dhtmlxTreeGrid has next method to get list of checked items
    treegrid.getCheckedRows(index)
where index - index of column with checkboxes ( 0, in case of above initialization)
Also component provides event for checkbox checking|unchecking

mygrid.attachEvent("onCheckbox",function(id,index,state){
    //any custom code here
    return true;
})

The major difference between checkboxes in dhtmlxtree and described approach - in case of dhtmlxTreeGrid only two-state checkboxes can be used ( by using events and custom code 3-state checkboxes can be simulated , but there is no native support for them )