Skip to main content

blockSelectionStart

pro version only

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

triggered when selection has been started

Usage

blockSelectionStart: (
startCell: { row: object; column: object },
endCell: { row: object; column: object },
handle: boolean,
event: MouseEvent | TouchEvent
) => void;

Parameters:

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

startCell(object) an object that contains the initial cell of the selection, includes the following properties:
  • row - (object) the row configuration object
  • column - (object) the column configuration object
endCell(object) an object that contains the end cell at the start of the selection, includes the following properties:
  • row - (object) the row configuration object
  • column - (object) the column configuration object
handle(boolean) indicates whether the handle is used (true) or a regular selection (false)
event(Event) the browser event: MouseEvent or TouchEvent

Returns:

Return false to cancel the action; otherwise, true.

Example

grid.block.events.on("blockSelectionStart", (startCell, endCell, handle) => {
console.log("Selection started:", startCell.column.id, startCell.row.id);
});

Related API: blockSelectionEnd

Change log:

added in v9.2