beforeBlockSelectionMove
pro version only
This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
triggered before moving the selection boundary
Usage
beforeBlockSelectionMove: (
startCell: { row: object; column: object },
nextCell: { row: object; column: object },
focusCell: { row: object; column: object } | null,
dragDirection: "up" | "down" | "left" | "right" | null,
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:
|
nextCell | (object) an object that contains the next cell to which the boundary is moving or the end cell of the previously selected boundary during the handle movement, includes the following properties:
|
focusCell | (object) an object that contains the last focus cell (if the handle is used) or null , includes the following properties:
|
dragDirection | (string) determines the direction of movement of the focused cell: "up" | "down" | "left" | "right" | null |
event | (Event) the browser event: MouseEvent or TouchEvent |
Returns:
Return false
to cancel the action; otherwise, true
.
Example
grid.block.events.on("beforeBlockSelectionMove", (startCell, nextCell) => {
console.log("Moving to:", nextCell.column.id, nextCell.row.id);
});
Related API: afterBlockSelectionMove
Change log:
added in v9.2