Skip to content

mapCells

applies the callback to a range of cells

function mapCells(
// the start row id
startrow: number,
// the start column id
startcol: string,
// the amount of rows
numrows: number,
// the amount of columns
numcols: number,
// the function calling for each cell in the specified range
callback: function,
// if true, the callback will be applied to the range of cells, but will not change their values
getOnly: boolean
): void
grid.mapCells(1, "title", 3, 2,
function(value, row_id, column_id, row_ind, col_ind) {
console.log(value, row_id, column_id, row_ind, col_ind);
});

also check the next samples:

Parameters of the callback function are:

  • value - (string,number) the cell value
  • row_id - (string,number) the row id
  • column_id - (string,number) the column id
  • row_ind - (number) the row index of a cell within the selected block
  • col_ind - (number) the column index of a cell within the selected block

If startrow === null, mapping starts from the first row of the grid. If startcol === null, mapping starts from the first column of the grid. If numrows === null, the callback is applied to all rows, starting from the startrow. If numcols === null, the callback is applied to all columns, starting from the startcol.

Articles

API