Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by TonyW on Oct 06, 2008 23:01
open dhtmlx forum
dhtmlxtreegrid/dhtmlxtree

Q1. - Is it possible to emulate the folderclosed/folderopen icons in dhtmlxtree when expanding a branch in dhtmlxtreegrid? It appears that all samples of dhtmlxtreegrid have no facility for changing the image on expand/collapse.
Q2. When grouping a grid, is it possible to capture the id of the last expanded, so that when the next group is expanded the previous may be programatically collapsed?
Thanks in anticipation!
Regards
TonyW
Answer posted by Support on Oct 07, 2008 02:57
The treegrid has a single fixed image for all states. 
Technically, you can simulate it through onOpenEnd event

grid.attachEvent("onOpenEnd",function(id,state){
    if (state==1) grid.setItemImage(id,"open.gif");
    else grid.setItemImage(id,"close.gif");
    return true;
});

>>when the next group is expanded the previous may be programatically collapsed
There is no ready to use events, which can be used in described scenario. The only solution is custom code modification, you can add any custom rules to the _switchGroupState method ( dhtmlxgrid_group.js ) which called each time when group closed|expanded.