Skip to main content

attach()

attaches a DHTMLX component into a Layout cell

attach(component: string | object, config?: object): object;

Parameters:

  • component: string | object - the name or object of a component
  • config: object - optional, the configuration settings of a component

Returns:

The object of the attached component.

Example

const layout = new dhx.Layout("layout_container", {
width:"400px", height:"600px"
});

const sidebar = new dhx.Sidebar(null, {
css: "dhx_widget--border_right dhx_widget--bg"
});

layout.getCell("sidebar").attach(sidebar);

Related sample: Layout. Attach

note

The DHTMLX Message, Popup, Window components can't be attached to the Layout cell because these components can't have the parent container due to their architecture principles.