history
pro version only
This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
Optional. Enables/disables the History module during the Grid initialization
Usage
history?:
| boolean
| {
limit?: number;
disabled?: boolean;
};
Default value: false
Example
const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "a", header: [{ text: "A" }] },
{ id: "b", header: [{ text: "B" }] },
],
data: [
{ id: "1", a: "A1", b: "B1" },
{ id: "2", a: "A2", b: "B2" },
],
history: true // enables the History module
});
The history
property can be set in two ways:
- as a boolean value it enables or disables the
History
module upon the component initialization - as an object it enables the module and allows setting additional parameters:
limit
- (number) the maximum number of actions stored in the history. When the limit is exceeded, the oldest actions are removeddisabled
- (boolean) iftrue
, the module is disabled on initialization, and no actions are recorded in the history
The example below demonstrates configuring the module with a history limit of 10 actions. The module is disabled on initialization:
const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "a", header: [{ text: "A" }] },
{ id: "b", header: [{ text: "B" }] },
],
data: [
{ id: "1", a: "A1", b: "B1" },
{ id: "2", a: "A2", b: "B2" },
],
history: {
limit: 10, // limits history to 10 actions
disabled: true // module is disabled on start
}
});
grid.history.enable(); // enabling the module
Related sample: Grid. History. Configuration
Related articles:
Change log:
added in v9.2