-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort Column Gets Reset (Server-Side Data) #1057
Comments
This is expected behavior with sever side, at the moment. The table does not currently have any way to distinguish which options individually you are managing server side vs client, so server side opts you in to all of them, more or less. This means you have to take the reigns and make sure the various options have the values you want when you update your data. |
Could you point me to the right direction on how to set that for the table state? I tried looking through the options, but can't find which option I need to set to choose the sort direction of the column.
|
@Ahsan-R-Kazmi , You can refer to this. You might get some idea.
|
So it seems, it works properly if I do something like:
but not if I get the exact same information from the server and use react to set the state (which is the way react would prefer, since the state should be immutable.)
|
I have a PR in that may make this easier to mange: #1086 Also, I implement the sort idea expressed here: #706 - Basically instead of tracking the table sort in the columns object, it would be a property on the options object. Personally I find this a lot easier to manage. If there's interest I could make a PR for that. |
Hello! |
@nora-sch what version of the table are you using? The PR I mentioned in my previous post got merged in and should mostly fix this problem. I'd recommend creating a new issue with a codesandbox showing the problem if it's still happening in the latest version. |
@patorjk I am having this issue as well. Having |
The sort column direction is getting reset after new data is retrieved from the server and set in the table. It also gets reset on page changes, rows per page changes, and search text changes. Is this intended behavior, and is there any way to override it?
Expected Behavior
The sort column should not change when new data is retrieved and set from the server.
Current Behavior
The sort column direction is getting reset after new data is retrieved from the server and set in the table. It also gets reset on page changes, rows per page changes, and search text changes.
The text was updated successfully, but these errors were encountered: