ag-grid provides a way to get selected rows using api.getSelectedRows()
function. And provides a way to set all rows using api.setRowData([])
function.
I'm looking for something getAllRows()
to return all the rows in the grid. I know there is a way to loop through all the rows using api.forEachNode()
etc.
Is there any way I can get the entire array of rows?
I don't think there is such a method but you can make your own:
getAllRows() {
let rowData = [];
this.gridApi.forEachNode(node => rowData.push(node.data));
return rowData;
}