material-table-core / core

Datatable for React based on material-ui's table with additional features. Support us at https://opencollective.com/material-table-core
https://material-table-core.github.io
MIT License
295 stars 146 forks source link

Save/Restore sorting with remote data #858

Open KippWade opened 2 months ago

KippWade commented 2 months ago

In our application, we save the sort order to our data store when the user sorts/filters the list. When the user returns to that particular list screen, we load the filters and sorting from the redux store.

We can reload the filters they had on the columns, using the Column defaultFilter prop.

I've tried to use the defaultSort prop in the same way, but didn't have any success.

I then tried to use the defaultOrderByCollection in the options, but when I load the page, it seems to default to the standard orderbycollection of all set to none.

I'm not sure if this is because we use remote data, or if the defaultOrderByCollection just isn't working right.

Any advise is appreciated.

https://stackblitz.com/edit/vitejs-vite-lmrvyn?embed=1&file=src%2FApp.tsx

What comes up image

What I expected image