Skip to main content

rangeSelection

pro version only

This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.

Optional. Enables/disables the RangeSelection module during the Grid initialization

Usage

rangeSelection?:
| boolean
| {
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" },
],
rangeSelection: true // enables the Range module
});

The rangeSelection configuration object can have the following properties:

  • disabled - (boolean) makes the module inactive upon initialization of the component
const grid = new dhx.Grid("grid_container", {
// other configuration
columns: [
{ id: "a", header: [{ text: "A" }] },
{ id: "b", header: [{ text: "B" }] },
],
data: [
{ id: "1", a: "A1", b: "B1" },
{ id: "2", a: "A2", b: "B2" },
],
rangeSelection: { disabled: true }
});

console.log(grid.range.isDisabled()); // -> `true` - module is inactive
grid.range.setRange({ xStart: "a", yStart: "1" }); // the range will not be set

Related articles:

Change log:

added in v9.2