Ag-grid: React agGrid - on new data sort is reset

Created on 14 Jun 2016  路  3Comments  路  Source: ag-grid/ag-grid

Hi,

I'm using the react version of the agGrid library with redux. When I update the state it causes a refresh of the table and removes the currently selected sort option. Is there an option similar to newRowsAction for sorting that keeps the sort order?

Most helpful comment

Worked out what it was - Inside my react component I was creating a new object inside the render method to represent the columns of the grid. Every time it was rendered the reference was changing and agGrid thought that the column definitions were changing therefore resetting the sorts.

All 3 comments

the grid does not loose sort when you update the rows. you must be completely destroying the grid and creating it again from scratch.

Worked out what it was - Inside my react component I was creating a new object inside the render method to represent the columns of the grid. Every time it was rendered the reference was changing and agGrid thought that the column definitions were changing therefore resetting the sorts.

yes if set in new columns, that resets the sort, as the sort is tied to the column.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

basvandenberg picture basvandenberg  路  3Comments

deepakjan picture deepakjan  路  3Comments

m-nagy picture m-nagy  路  3Comments

rboughani picture rboughani  路  3Comments

ceolter picture ceolter  路  3Comments