Collapse all accordion cells

Hello,



Is it possible to collapse all cells?



Thanks

Hello,

dhtmlxAccordion does not have such functionality.


Hi,



Would it be possible for me to go into the source and try to enable this behavior?   If so, could you please point me to where I should look?



 



Thanks

Sorry for inconvenience, there was an error in previous anser, you can do this using closeItem() method.

dhxAccord.closeItem(itemId);





Hi,



When I tried this, using the following code:



var dhxAccord = new dhtmlXAccordion(“accordObj”,“dhx_blue”);



//dhxAccord.setEffect(true);



dhxAccord.addItem(“a1”, “Mark’s Dev”);



dhxAccord.addItem(“a2”, “Old UAT”);



dhxAccord.addItem(“a3”, “Google”);


dhxAccord.cells(“a1”).attachURL(“http://yahoo.com”);



dhxAccord.cells(“a2”).attachURL("google.com);  // this is open by default since it is the last one



dhxAccord.closeItem(“a3”);



 



The last cell doesn’t really collapse, it just fills the background with the default skin color.



 



What I’m trying to do is have all cells collapse, and when clicking on an already open cell, having that cell collapse. 



 



Could you direct me on how I could modify the source to achieve this?



 



Thanks



 

Cell is collapsed, but global container (“accordObj” in your case) stays after collapsing all cells and it have this background color.
Try to change its height after collapsing last cell, and restore height to previous before expanding any one.