I am trying to clear all current rows from my ag-grid. I tried to do this:
aggridOptions.api.setRowData([]);
but this adds me "No rows to show" dialog, then when I am updating the grid with new data the dialog is still appears.
Is there correct way to clear the grid from data rows?
Sometimes your users want to remove rows and cells in AG Grid by pressing Backspace or Delete keys. The following example uses api. applyTransaction ({...}) to remove selected rows, when the user presses BACKSPACE or DELETE keys.
selectAll() : Select all rows in the grid, regardless of filtering. api. deselectAll() : Un-select all rows, regardless of filtering.
For updating rows, the grid will find the row with the same key and then swap the data out for the newly provided data. For removing rows, the grid will find the row with the same key and remove it. For this reason, the provided records within the remove array only need to have an key present.
I've taken a look and this is bug - we'll issue a fix for it in the next release. We'll be issuing a new release on Friday, which will include the fix for this - the next version will be ag-grid 6.3.0.
In the meantime, you can add the following line after addItems
which should remove the overlay:
gridOptions.api.hideOverlay()
As I say though, from Friday this line won't be necessary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With