Skip to main content

beforeCollapse

fires before collapsing a treegrid

note

The event works only for Grid with the type: "tree" configuration option

beforeCollapse: (rowId: string | number) => boolean | void;

Parameters:

The callback of the event is called with the following parameter:

  • rowId: string | number - the id of a collapsed row

Returns:

Return false to block collapsing of a grid; otherwise, true.

Example

const grid = new dhx.Grid("grid_container", {
type: "tree",
columns: [
// columns config
],
data: dataset,
});

grid.events.on("beforeCollapse", (rowId) => {
// your logic here
return false;
});

Change log:

added in v6.4