How can I get all the rows of ag-grid?

前端 未结 4 1415
名媛妹妹
名媛妹妹 2021-02-19 09:57

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.

4条回答
  •  误落风尘
    2021-02-19 10:58

    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;
    }
    

提交回复
热议问题