-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[data grid] valueFormatter doesn't show the updated value after processRowUpdate #11486
Comments
@atsoy thanks for reporting this. The issue is with the return value of the 'handleProcessRowUpdate' - it should be an array with the mutated row objects. You can see it working here: https://codesandbox.io/p/sandbox/dgp-cellupdate-bug-forked-2slznj?file=%2Fsrc%2Fdemo.tsx%3A110%2C32 |
@atsoy I check it again, there indeed might be a problem with the |
Why do you need to keep your rows in the state? This seems to be causing the problem. if you check this example the issue will be more visible: https://mui.com/x/react-data-grid/editing/#server-side-persistence |
Thanks for checking @DanailH ! The example I've provided based on local state, in reality we use reducer (useReducer), where our data is being stored. Users can manipulate table data and then send it to the server (not after each edit stop, but form like - pressing on submit button). I'm not sure I understand the view point of "storing data in state seems to be causing the issue". Updated data is being set properly. Please elaborate. P.S: The process of updating the rows, formatting updated values etc worked without issues by using |
@DanailH gentle ping! 🙇🏼 |
Hi @michelengelen @DanailH , I understand that you're working on this project voluntarily, and I truly appreciate the time and effort you invest in it. If possible, could you provide an ETA for when this issue might be fixed? Thank you once again for your dedication to the project! |
@atsoy I'm sorry for the delay. I checked it again and the issue is that I've updated the example again https://codesandbox.io/p/sandbox/dgp-cellupdate-bug-forked-9kxt24 |
@DanailH thanks for coming back! I've updated provided example.
It actually happens, but after that, I assume grid re-renders after some effect and restores probably from internal grid state. |
@mui/xgrid can someone take a look? It might be that I don't understand the issue. |
This looks like a regression introduced in 6.18.3 |
While this looked like a regression at first glance, I'm not sure about this now. Added delay makes it clear that it's a race condition - the @atsoy Before we proceed with further investigation, did you consider using |
@cherniavskii thanks for your input!
Yes, I'll try to use that as a workaround and will give an update P.S: I'm not sure if it's the right place, but did you or do you consider to provide e.g an option / method to access the current grid data as it is (since there are already possibilities to export CSV or printable data). |
The same data that you pass to the grid through the |
Sorry, I mean of course not the same data, which is provided to Use case e.g to get avoid usage of |
Hey @cherniavskii , thanks again for the provided workaround idea. I've implemented it in multiple tables. However I think I found another bug, which is be related to the existing one (or may be have same source): In case of the let's say price field i expect the input like I didn't add the See example If you uncomment (valueGetter) it will work fine, but still not the desired functionality (imo), because of provided data, which should be updated in the internal grid state as well and rendered in cells. |
to follow up: will this be considered as a bug or may be analized? I ask because of this statement.
|
Hey @atsoy I've looked into the codesandbox you provided. |
Not sure if you're still going to need it, but you can get a single row using API object - |
The issue has been inactive for 7 days and has been automatically closed. |
Hi @cherniavskii thanks for explanation. I think this cannot be considered as a bug. So I just comment it and will close this issue. Again, thanks for the efforts! |
How did we do @atsoy? |
Steps to reproduce
Link to live example: (required): https://codesandbox.io/p/sandbox/dgp-cellupdate-bug-rzkwcr
Steps:
Current behavior
total
column does not display updated value (product ofamount
andprice
).As soon as another row's cell get an updated value, then previous edited row's
total
shows correct valueExpected behavior
total
column shows updated value, after one of the columnsamount
||price
were updated.Context
Idea ist to update the total column's cell in the same row, which multiplies
amount
andprice
columns, after cell editing ist finished.After some analysis I've noticed, that
valueFormatter
actually does get the updated value and formats it correct, but after that it's being called again, but with old value.P.S: It worked before, but since we've updated
x-data-grid-pro
to the 6.18.3 it was broken (also tested with6.18.5
)Your environment
npx @mui/envinfo
Search keywords: datagridpro processrowupdate valueformatter
Order ID: 62555
The text was updated successfully, but these errors were encountered: