DHTMLX Docs & Samples Explorer

Index
dhtmlxAccordion
Content Attaching

# Object attaching

There is the possibility to add an object to any “objectless” accordion's item. To do this, you should firstly create this object on the page, and then, write one line of code to attach this object to an item of the accordion.

For example, we will create a <div> element with the id “objId” and with some text inside it.

    <body>
       <div id="objId">
       ...
       </div>
    </body>

Then, we just will use the attachObject() method to attach this object we've just created to an Accordion item:

    dhxAccord.cells("a1").attachObject("objId");

See 'DHTMLX Components Integration' section for the information on attaching dhtmlx components to dhtmlxAccordion.

## Object Size Handling

By default, the items have overflow:hidden style.

In case the item is not able to display the whole object, the following style should be specified for an object:

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

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