I have tried to use ag grid for angular 2 and faced with the following behavior:
When I'm trying to type anything in column filter, grid is going to reload and reset filter as well. It happens not only if I type something for filtration but even if I'm trying to change type of the filter.
Anybody had similar issue?
Example: Get / Set All Filter Models Set Custom Filter Model takes a custom hard-coded filter model and applies it to the grid. Reset Filters will clear all active filters. Destroy Filter destroys the filter for the Athlete column by calling gridApi. destroyFilter('athlete') .
The easiest way to update data inside the grid is to replace the data you gave it with a fresh set of data. This is done by either updating the rowData bound property (if using a framework) or calling api. setRowData(newData) .
Check this live example ag-grid: Built-In Filters - log the filters applied. Apply age and year filters and then click Log Filter button. age: {column: Column, filterPromise: Promise, scope: null, compiledElement: null, guiPromise: {…}}
I resolved this issue by adding property : newRowsAction: 'keep'
columnDefinition = {
headerName: 'Athlete',
field: 'athlete'
// set the column to use text filter
filter: 'text',
// pass in additional parameters to the text filter
filterParams: {apply: true, newRowsAction: 'keep'}
}
From the ag-grid docs : https://www.ag-grid.com/javascript-grid-filtering/#gsc.tab=0
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