admin管理员组文章数量:1355789
Could you please take a look into the tiny sandbox project?
I have a simple react table, each row contains a "raw" data and the same data as a select box value. when I delete a row, the table is rerendered correctly, the "raw" data is displayed correctly, but the selected value in the select boxes stay unchanged. Why?
Thanks in advance!
P.S. when I try to change the Select attribute from "defaultValue" to "value", the row deletion start to work correctly, but in this case it is not possible any more to modify the selectbox value.
Could you please take a look into the tiny sandbox project?
https://codesandbox.io/p/sandbox/festive-nova-s58h2v
I have a simple react table, each row contains a "raw" data and the same data as a select box value. when I delete a row, the table is rerendered correctly, the "raw" data is displayed correctly, but the selected value in the select boxes stay unchanged. Why?
Thanks in advance!
P.S. when I try to change the Select attribute from "defaultValue" to "value", the row deletion start to work correctly, but in this case it is not possible any more to modify the selectbox value.
Share Improve this question edited Mar 28 at 12:16 Andrei Isakov asked Mar 28 at 7:56 Andrei IsakovAndrei Isakov 591 silver badge3 bronze badges1 Answer
Reset to default 0I managed to resolve the issue. I added an "external" onChange handler to my select box properties. The handler comes from the parent table and it rewrites the columns model on the update event. The sandbox project now works as expected
本文标签: javascriptselect box cell renderer does not update when deleting a react table rowStack Overflow
版权声明:本文标题:javascript - select box cell renderer does not update when deleting a react table row - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744049776a2582208.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论