React Table 更新数据时移除过滤器
React Table removes Filters when updating data
我正在使用 material ui 反应厨房水槽示例 table (https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/material-UI-kitchen-sink)
我的数据经常更新,问题是每次更新数据时过滤器都会被清除。您可以通过在 codesandbox 示例中设置过滤器并更改单元格中的值来尝试此操作。 onBlur 它设置状态并清除过滤器并取消选中复选框。
有没有办法防止这种情况或 solution/workaround?
非常感谢!
将全局过滤器的自动重置标志设置为 false
-
autoResetGlobalFilter: false
固定 CSB - https://codesandbox.io/s/strange-oskar-sqefh?file=/src/components/EnhancedTable.js:3191-3226
更多详情 - https://react-table.tanstack.com/docs/api/useGlobalFilter#table-options
我正在使用 material ui 反应厨房水槽示例 table (https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/material-UI-kitchen-sink)
我的数据经常更新,问题是每次更新数据时过滤器都会被清除。您可以通过在 codesandbox 示例中设置过滤器并更改单元格中的值来尝试此操作。 onBlur 它设置状态并清除过滤器并取消选中复选框。
有没有办法防止这种情况或 solution/workaround?
非常感谢!
将全局过滤器的自动重置标志设置为 false
-
autoResetGlobalFilter: false
固定 CSB - https://codesandbox.io/s/strange-oskar-sqefh?file=/src/components/EnhancedTable.js:3191-3226
更多详情 - https://react-table.tanstack.com/docs/api/useGlobalFilter#table-options