I use dhtmlxLayout and accordion to build page. The accordion is attached to a div which is included the div attached to “b” item in dhtmlxLayout. When I want to add some html object to any item of the accordion, I can’t find anything on the page. Why is this?
My code almost like this:
dhxLayout = new dhtmlXLayoutObject(document.body, "5I");
dhxLayout.cells("a").setHeight(150);
dhxLayout.cells("a").hideHeader();
dhxLayout.cells("a").attachObject("layoutA");
dhxLayout.cells("b").setWidth(250);
dhxLayout.cells("b").attachObject("layoutB");
//the following is the accordion
var dhxAccordLeft = new dhtmlXAccordion("leftTree");
dhxAccordLeft.addItem("a", "A栋");
dhxAccordLeft.addItem("b", "B栋");
dhxAccordLeft.addItem("c", "C栋");
dhxAccordLeft.cells(id).attachObject("leftAccordTemplate");
//the following is some of the html code
<!-- layoutB -->
<div id="layoutB" style="background-color:#e3e3e3">
<div id="leftTree"></div>
</div>
<div id="leftAccordTemplate">
xdsdfewr<input type="text"/>
</div>
Hi, Darya. I just found out the answer last night. After I added “dhxAccordLeft.enableMultiMode(1);”, the accordion worked normally, but I didn’t know why. And how do I do to make the cell on the accordion height auto. I mean when the content height is higher than the cell, the cell will reset the height itself to adapt the content?
To set autoheight for a cell you can use the next:
myAccordion.cells(“a1”).setHeight(‘*’);
Multimode has its own default cell height. If you set for cell “a1” autohtight - it will just increase its height to fill the rest apce of the container - see the image