Skip to main content

on

Optional. Adds handlers to DOM events of a cell

on?: {[key: string]: any; };

Example

// adds a click event handler to the element of a cell
const layout = new dhx.Layout("layout_container", {
height: "100%",
rows: [
{
html:"<div className='my-element' style='height:100%;width:100%'></div>",
on: {
click: (event) => alert("my-element")
}
},
]
});

// or
// adds a click event handler to the element inside a cell by selector
const layout = new dhx.Layout("layout_container", {
height: "100%",
rows: [
{
html:"<div className='my-element' style='height:100%;width:100%'></div>",
on: {
click: {
".my-element": (event) => alert("my-element")
}
}
},
]
});