- How do I get all the selected rows in ag-grid?
- How do I get the index of a selected row in ag-grid?
- How do I enable checkbox selection in ag-grid?
How do I get all the selected rows in ag-grid?
To get the currently selected rows you can then use the grid API method getSelectedRows() to return a list of all the currently selected row data.
How do I get the index of a selected row in ag-grid?
You can get the specific row and cell index of the grid by using rowSelected event of the grid. Here, we have get the row and cell index by using aria-rowindex(get row Index from tr element) and aria-colindex(column index from td element) attribute.
How do I enable checkbox selection in ag-grid?
To configure the column to have a checkbox, set colDef. headerCheckboxSelection=true . headerCheckboxSelection can also be a function, if you want the checkbox to appear sometimes (e.g. if the column is ordered first in the grid).