disable()
pro version only
This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
disables the module, preventing the addition of new actions to the Grid history and the execution of any operations
disable(): void;
Example
// The example shows disabling the module after adding an action
const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "name", header: [{ text: "Name" }] },
{ id: "value", header: [{ text: "Value" }] },
],
data: [
{ id: "1", name: "Item 1", value: 10 },
],
history: true
});
// adding an action
grid.history.add({
type: "change",
batch: [{ id: "1", name: "Updated Item", value: 15 }],
inverse: { type: "change", batch: [{ id: "1", name: "Item 1", value: 10 }] },
});
// disabling the module
grid.history.disable();
console.log(grid.history.isDisabled()); // -> true
// attempting to add a new action
grid.history.add({
type: "add",
batch: [{ id: "2", name: "New Item", value: 20 }],
});
console.log(grid.history.getHistory().length); // -> 1 (the new action hasn't been added)
Related article: Enabling/disabling History module
Related API: enable()
, isDisabled()
Change log:
added in v9.2