DHTMLX Docs & Samples Explorer

Object Constructor

Constructor is used to create an object, to set its initial parameters.

There are some ways to do it:

  • Common declaration
  • Nested layout
  • Object notation

Common declaration

    var layout = new dhtmlXLayoutObject(parent, view, skin)


  • parent - the id of an HTML element that will be used as parent
  • view - the layout type (optional)
  • skin - the skin type (optional)
    <div id="parentId" style="width:500px; height:150px;"></div>
        // common init code
        var layout = new dhtmlXLayoutObject("parentId");

or object itself

    //fullscreen init
    var layout = new dhtmlXLayoutObject(document.body, "3L");

Nested Layout

Layout, Window, Accordion, Tabbar can create a layout inside their cells by using


Object notation

Starting from 2.5 version, layout can be initialized by object notation.

    layout = new dhtmlXLayoutObject({
        parent: document.body,
        skin: "dhx_blue",
        onExpand: function(){
            alert("I'm clicked");	

The list of all supported options you can see here