提交 52b639fa 编写于 作者: A afc163

Should update table data when changing pageSize

fix #317
上级 74b2c8fc
......@@ -35,7 +35,8 @@ for (let i=0; i<46; i++) {
var pagination = {
total: data.length,
current: 2
current: 2,
showSizeChanger: true
};
React.render(<Table columns={columns} dataSource={data} pagination={pagination} />
......
......@@ -304,6 +304,13 @@ let AntTable = React.createClass({
});
},
handleShowSizeChange(current, pageSize) {
let pagination = objectAssign(this.state.pagination, {
pageSize: pageSize
});
this.fetch({ pagination });
},
renderPagination() {
// 强制不需要分页
if (!this.hasPagination()) {
......@@ -321,6 +328,7 @@ let AntTable = React.createClass({
onChange={this.handlePageChange}
total={total}
pageSize={10}
onShowSizeChange={this.handleShowSizeChange}
{...this.state.pagination} /> : null;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册