-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Edit and Sort combination support for DataTable #878
Comments
Having the same problem. Any solution or fix yet? Thanks. |
Hi, Fixed for PrimeReact and PrimeVue. The DataTable component never stores the user's data. Therefore, in any state change, the sort and filter events are called again. That's why you can use onValueChange to send the data that changes during these events to the user. With this callback, you can sync the calculated data with the data you give to the DataTable. Exp;
Best Regards, |
Won't this still make the sorting move while you type? Doesn't this lead to issues with pagination? Or is this only called after Changes are finished / onBlur is called? |
I still have this issue on version 6.5.0 The grid is sorted and when I click on a cell to edit the rows are re-ordered. I tried the onValueChange example above, however it seems that the grid fires onValueChange only when the user clicks on the cell to edit it. Ideally the event should be fired as soon as the data passed to the grid in the 'value' prop is changed. This issue is a blocker for me, any help will be appreciated. |
I'm submitting a ...
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/ox0kn6o559
Current behavior
On datatable with a editable and sortable column, if you sort then edit a column the inserted values will skip validation and resort as you type.
Expected behavior
The resort to not occur until after editing and validation is complete.
Minimal reproduction of the problem with instructions
https://codesandbox.io/s/ox0kn6o559
Click the table header for "last year sale" in the sandbox example to sort it ascending. Afterwards, click to edit the first column ( should be Song brand row at 17%). Edit this to 99. Song brand row will now jump to the bottom and you will now be editing the Microsoft brand row. If validation is provided then validation will not execute either for the Song brand record.
React version:
16.7.0
PrimeReact version:
3.1.2
Browser: all
Language: all
The text was updated successfully, but these errors were encountered: