Skip to content
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

🐛[BUG] ProTable 分页问题 #71

Closed
isseptember opened this issue Jul 31, 2020 · 4 comments
Closed

🐛[BUG] ProTable 分页问题 #71

isseptember opened this issue Jul 31, 2020 · 4 comments
Labels
⭕️ bug Something isn't working table

Comments

@isseptember
Copy link

🐛 bug 描述

ProTable 分页bug。非第1页,将pageSize改为比现有size小的数时,没有重新请求更新数据,表格显示的是原有页码的前几条,且当前页码显示为第1页,不正确([antd: Table] dataSource length is less than pagination.total but large than pagination.pageSize. Please make sure your config correct data with async mode.)

📷 复现步骤

1、初始状态,默认current为1,pageSize为20,请求current=1&pageSize=20,得99-80 --- 正确
2、点击下一页,current为2,pageSize为20,请求current=2&pageSize=20,得79-60 --- 正确
3、切换pageSize为10,没有重新请求,表格显示79-70,底部显示当前页码为第1页,控制台出现警告 --- 错误
4、点击下一页,没有发送请求,显示69-60,再下一页表格将为空 --- 错误

🏞 期望结果

3中,请求current=2&pageSize=10

💻 复现代码

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

@isseptember isseptember changed the title 🐛[BUG] 🐛[BUG]ProTable分页问题 Jul 31, 2020
@chenshuai2144 chenshuai2144 changed the title 🐛[BUG]ProTable分页问题 🐛[BUG] ProTable 分页问题 Aug 2, 2020
@chenshuai2144 chenshuai2144 added table ⭕️ bug Something isn't working labels Aug 2, 2020
@chenshuai2144
Copy link
Contributor

fixed,现在会重置页码

@liuml
Copy link

liuml commented Jun 30, 2021

这个问题现在依旧还在

@coocier
Copy link

coocier commented Jul 23, 2021

配合EditableProTable使用时,如果开启了行内新增数据,同时设置了pagination: {pageSize: number},在点击新增的时候还是会出现警告提示([antd: Table] dataSource length is less than pagination.total but large than pagination.pageSize. Please make sure your config correct data with async mode) @chenshuai2144

@SilentFlute
Copy link

贴一个我自己的解决方法供大家参考: ##3436 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭕️ bug Something isn't working table
Projects
None yet
Development

No branches or pull requests

5 participants