Ag-grid: Column state gets lost on rows load

Created on 21 Mar 2017  路  3Comments  路  Source: ag-grid/ag-grid

Hello,

I'm using ag-grid-react and setting the column state on onGridReady with something like:

api.columnpApi.setColumnState(previously_saved_state)

I can see that works but as soon as the row-data gets loaded (the ReactJS way), the column state gets reset to the default one.

I have also tried setting the state in onRowDataChanged and other callbacks and they either fail or ignore the restored state.

Thanks.

bug

Most helpful comment

@pupeno are you referring to filter state when you say its being reset?

If so, set filterParams: {newRowsAction: 'keep'} on the column(s) you want to maintain state, or on

gridOptions.defaultColDef to be global

All 3 comments

I've raised a high priority issue (AG-353) our side for this. We'll update this thread with updates as soon as we have any

cannot reproduce. i went to main demo and set some column state (sort, filter, reorder) and then called gridOptions.api.setRowData([]); (using the debug console) and the data reset, but all column state was retained.

maybe you are loosing filter because you don't have newRowsAction='keep'

@pupeno are you referring to filter state when you say its being reset?

If so, set filterParams: {newRowsAction: 'keep'} on the column(s) you want to maintain state, or on

gridOptions.defaultColDef to be global

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spryor picture spryor  路  3Comments

m-nagy picture m-nagy  路  3Comments

simkessy picture simkessy  路  3Comments

ballwood picture ballwood  路  3Comments

DominicTobias picture DominicTobias  路  3Comments