DHTMLX Docs & Samples Explorer

Index
dhtmlxlayout
Content Attaching

# Object Attaching

If you need to attach an object to the certain layout item - make the following steps:
1. Create an object on the page. For example, a <div> element with the id “objId” and with some text inside it.
2. Attach the object to the layout item:

    <div id="objId">
      Some text
    </div>
    <script>
       dhxLayout.cells("a").attachObject("objId");
       // or
       var obj = document.getElementById("objId");
       dhxLayout.cells("a").attachObject(obj);
    </script>

If you need to attach an object without removing the current cell's content - use the appendObject() method.

## Object Size Handling

By default, panels have 'overflow:hidden' style.

In this case the panel is not able to display a whole object. To correct this - specify the following style for an object:

    <div id="objId" style="width:100%;height:100%;overflow:auto;...">

Now the panel will display the scroll bar in case an object does not fit panel's size.