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

Table Pagination returns wrong record range when get less data in Table 表格组件下分页组件工作异常 #5259

Closed
SecMao opened this issue Mar 10, 2017 · 1 comment
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@SecMao
Copy link

SecMao commented Mar 10, 2017

Environment(required)

  • antd version:2.8
  • OS and its version:Win 10
  • Browser and its version:Chrome 56.0.2924.87 (64-bit)

What did you do? Please provide steps to re-produce your problem.

When I'm using a Pagination in Table, there goes to a bug.
For example, I set pageSize as 5 and set showTotal function returning a string 'Total x, now showing y to z' so I can see the changes.
First, the table shows more than 2 pages, e.g. 10, I change to page 5 or any other page after page 2.
Than, give the table a new dataSource, whose length is less than the current page range. When I'm in page 5, the table should show range 21 to 25. So I set dataSource containing 6 records.
Here it is. The Pagination will automatically reduce to 2 pages where still be good but the total tip gives me a string tells 'Total 6, now showing 21 to 6'.

如果一张表格 pageSize 是5, showTotal展示'共x条记录,当前展示第y条至第z条'。
首先表格的总分页数必须大于2,比如10页,切换至第5页或第2页后的任一页。
然后刷新表格数据源,记录条数要小于当前页的展示范围,比如第5页展示21条至25条,设置新记录数为6条。
然后发现,分页能够正确的减少至2页,但提示信息却展示'共6条记录,当前展示第21条至第6条'

What happen?

I have followed the code track, then I find in the getMaxCurrent function in Table always return a current - 1 when the range lager than total. It must be a mistake.

表格组件中getMaxCurrent方法在展示范围大于总数时,始终返回current - 1。 因此在第2页缩减为1页数据显示正常,如果原数据超过两页,则无法正常显示。

Re-producible online demo

I write a template to show the bug online.在线示例
http://codepen.io/SecMao/pen/EWWmPx?editors=0010

Hope fixed ASAP, thanks.

@ddcat1115 ddcat1115 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Mar 10, 2017
afc163 referenced this issue Mar 19, 2017
@lock
Copy link

lock bot commented May 1, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants