How to Get All Rows in Ag-Grid


The easiest way to get the content of all rows’ data, back into a Javascript/Typescript array, is as follows.

Simply create a blank array, then loop through the rows of the grid and append each row to the array.

getAllRows() {
  let rowData = [];
  this.gridApi.forEachNode(node => rowData.push(node.data));
  return rowData;
}