setCell()
sets selection to specified cells
setCell(row?: object | string | number, column?: object | string | number, ctrlUp?: boolean, shiftUp?: boolean): void;
Parameters:
row: object | string | number
- an object with a cell to be selected or the id of a rowcolumn: object | string | number
- the config of a column or its idctrlUp: boolean
- true - to select the desired rows or cells, otherwise - false (for multiselection mode)shiftUp: boolean
- true - to select a range of rows or cells, otherwise - false (for multiselection mode)
Example
const grid = new dhx.Grid("grid_container", {
columns: [
// columns config
],
selection:"cell",
multiselection: false,
data: dataset
});
const row = grid.data.getItem(grid.data.getId(0));
const column = grid.getColumn("yearlyChange");
grid.selection.setCell(row, column);
note
For details about how to set selection to multiple cells/rows, see Setting selection to cells.
Related sample: Grid. Multiselection