Skip to content

eachRow

iterates over all rows in the grid

function eachRow(
// the handler function that receives one parameter - the ID of the data record (row)
handler: function,
// if true, hidden rows are included into a loop
all?: boolean
): void
dgrid.eachRow(function(row){
const record = dtable.getItem(row);
// { id:row, title:"Film", year:2019 }
record.title += " (" + record.year +")";
delete record.year;
this.updateItem(row, record);
});
  • Basically, the order of iteration is the order in which rows were added to the grid, but not necessarily so.
  • If you apply filtering to the grid, only visible rows will be iterated. To iterate all rows, set the all parameter to true.