当反应表(反应表)数据发生变化时,为什么反应表分页自动自动重置?
我使用其cell
属性向我的表列列表添加了4个自定义列。每行中的每一列中的每一个都包含一个复选框,该复选框会更改表数据状态中的特定属性;它的数据状态结构类似:
export type dataTypes = {
id: number;
getAccess: boolean;
insertAccess: boolean;
editAccess: boolean;
deleteAccess: boolean;
}[];
我不想要 react-table (v7.7.7.0)分页重置为第一页该表的数据状态通过复选框(还与表的过滤器和排序)进行了修改。
有人知道吗?
I added 4 custom columns to my table columns list using its Cell
property; each of these columns in every row contains a checkbox that changes a specific property in the table's data state; its data state structure is something like so:
export type dataTypes = {
id: number;
getAccess: boolean;
insertAccess: boolean;
editAccess: boolean;
deleteAccess: boolean;
}[];
I don't want react-table (v7.7.0) pagination to reset to its first page when the table's data state is modified by the checkboxes (also about the table's filter and sort).
Does anyone know about it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过添加
autoresetPage:false
,autoresetfilters:false
和autorestortby:false
usetable hook off light 所以:I solved this problem by adding
autoResetPage: false
,autoResetFilters: false
, andautoResetSortBy: false
touseTable
hook like so: