Check documentation for the latest version of dhtmlxSuite setHeight DHTMLX Docs

setHeight

sets cell's height (multi mode only)

void setHeight(type height);
heighttypeheight for whole cell (with header)

Example

var myAcc = new dhtmlXAccordion("accObj");
myAcc.enableMultiMode();
 
// static height
myAcc.cells(id).setHeight(200);
 
// for dyn height
myAcc.cells(id).setHeight("*");
 
// dyn height from api-init
var myAcc = new dhtmlXAccordion({
    parent: "accObj",
    multi_mode: true,
    items: [
        {id: "a1", text: "Text", height: "*"},
        ...
    ]
});

Details

There's a dynamic height mode in the multi mode. This mode is set for a cell through the setHeight("*"). It is important that a parent must have a fixed height for a dynamic height mode to work properly. If an accordion is attached to a layout, a window, a tabbar or to another accordion, the parent height is calculated automatically.

<!-- make sure parent have specified height -->
<div id="accObj" style="width: 300px; height: 400px;"></div>
// init
var myAcc = new dhtmlXAccordion("accObj");

The main feature of this mode is that an opened dynamic cell will take all the free space. If there are more than one dynamic cells opened, free space is equally divided among them.

Back to top