setCell

sets selection to specified cells

void setCell(object|string row,object|string column,boolean ctrlUp,boolean shiftUp);

Parameters

rowobject|stringan object with a cell to be selected or the id of a row
columnobject|stringthe config of a column or its id
ctrlUpbooleantrue - to select the desired rows or cells, otherwise - false (for multiselection mode)
shiftUpbooleantrue - to select a range of rows or cells, otherwise - false (for multiselection mode)

Example

var grid = new dhx.Grid("grid_container", {
    columns: [// columns config],
    selection:"cell",
    multiselection: false, 
    data: dataset
});
 
var row = grid.data.getItem(grid.data.getId(0));
var column = grid.getColumn("yearlyChange");
grid.selection.setCell(row, column);

Related samples

Details

For details about how to set selection to multiple cells/rows, see Setting selection to cells.

See also
Back to top