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设置filter后,不会跳转到table的第一页? #1669

Closed
seraphimrose opened this issue May 12, 2016 · 5 comments · Fixed by #1715
Closed

当Table设置filter后,不会跳转到table的第一页? #1669

seraphimrose opened this issue May 12, 2016 · 5 comments · Fixed by #1715
Assignees

Comments

@seraphimrose
Copy link

假设table有10页数据,选择到第10页,设置filter后只剩5页,而由于当前是第10页,Table会显示“暂无数据”。

antd版本:0.12.12

@seraphimrose
Copy link
Author

可能描述有点不清,是指选了 预先定义的某个filter 后导致数据量会减少 但因为本身不会跳转到第一页而出现 不存在的空页

@superRaytin
Copy link
Contributor

superRaytin commented May 12, 2016

使用官网的例子,按照这样操作貌似不能重现:http://012x.ant.design/components/table/#demo-paging

0.12.x 没有 standalone 版本,也不好写 codepen,不过还是麻烦你提供下能重现的 demo:http://codepen.io/anon/pen/wGOWGW?editors=001 😂 方便我本地进行测试

@seraphimrose
Copy link
Author

seraphimrose commented May 13, 2016

直接提供中间的代码好了

const columns = [{
title: '姓名',
dataIndex: 'name'
}, {
title: '年龄',
dataIndex: 'age',
filters: [{
text: "大于30岁",
value: "30"
}],
onFilter: (value, item) => parseInt(item.age) > parseInt(value)
}, {
title: '住址',
dataIndex: 'address'
}];

const data = [];
for (let i = 0; i < 46; i++) {
data.push({
key: i,
name: 李大嘴${i},
age: i,
address: 西湖区湖底公园${i}号
});
}

return

就是生成View后,上述例子选到第五页,再进行filter设置,不会进行常规的首页跳转,而是显示无数据,这样应该会产生误导吧?

@seraphimrose
Copy link
Author

seraphimrose commented May 13, 2016

上面的<Table 这几个字好像被github吞了

看一下吧~谢啦 @superRaytin

@lock
Copy link

lock bot commented May 5, 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 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants