Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sumit on Jul 02, 2007 11:18
open dhtmlx forum
Please Answer following quetion so that i can go for license purchase. 1: As Soon as some node is expanded how can i select the expanded node so that when i do tree.getSelectedItemId() it should return me id of the node which has been expanded. 2. As soon as some node is Squeezed its parent node should be selected so that tree.getSelectedItemId() should return parent of squezzed node. 3. which function is actually called when a node is expanded/squeezed.

Answer posted on Jul 04, 2007 13:08
in case of dhtmlxTreeGrid you can attach an event which will fire on expanding/collapsing nose
    grid.setOnOpenStartHandler(function(id){
       //any custom code here
    });

to autoselect on open you can use

    grid.setOnOpenStartHandler(function(id){
       grid.setSelectedRow(id);
    });

this will work for both expanding|collapsing

>>which function is actually called
There is no hardcoded functions, but you can use described approach to attach any custom reactions on node expanding|collapsing


Answer posted on Jul 04, 2007 13:12
In case of dhtmlxTree - approach is the same, but the names slightly different

tree.attachEvent("onOpenStart",function(id){
    //any custom code here
});

for auto selection

tree.attachEvent("onOpenStart",function(id){
    tree.selectItem(itemId);
});
Answer posted by Nadine (Support) on Dec 11, 2014 12:20

Not much can be said in addition to the reply above, but you also can check easy website builder and rowspan css and find out what we have probably missed in our explanation.