Almost all DHTMLX components can be attached directly to a cell by the corresponding method.
Accordion |
|
Carousel |
|
Chart |
|
DataView |
|
Editor |
|
Form |
|
Grid |
|
Layout |
|
List |
|
Menu |
|
Ribbon |
|
Scheduler |
|
Sidebar |
|
StatusBar |
|
Tabbar |
|
Toolbar |
|
Tree |
|
TreeView |
|
We highly recommend you to follow this way of attaching components, as it guarantees proper rendering and correct resizing of embedded components in relation to their parent container.
Make sure you've included the corresponding JS/CSS files of the related component on a page, for example:
<head>
<link rel="stylesheet" type="text/css" href="dhtmlxgrid.css">
<script src="dhtmlxgrid.js"></script>
</head>
Related sample: Integration with dhtmlxGrid
There is a possibility to get link to the attached component:
var attached = myTabbar.tabs(id).getAttachedObject();
if (window.dhtmlXGridObject != null && attached instanceof window.dhtmlXGridObject) {
console.log("An attached grid detected");
}
// attach
var myAcc = myTabbar.tabs(id).attachAccordion({...});
// detach later
myTabbar.tabs(id).detachObject(true);
myAcc = null;
Please note, the attachScheduler method differs from other attaching methods. The difference is that attachScheduler not only attaches the component but also initializes it - creates an instance with the predefined structure.
Therefore:
myTabbar = new dhtmlXTabBar("my_tabbar");
myTabbar.addTab("a1", "Tab 1-1", null, null, true);
myTabbar.addTab("a2", "Tab 1-2");
// configure scheduler if needed
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
// then attach it to the tabbar
myTabbar.tabs("a1").attachScheduler(new Date(), "month");
// load some data
scheduler.load("../common/events.xml");
Related sample: Integration with dhtmlxScheduler
Back to top