修复本地模式的 table 分页 current 页面失效的问题

This commit is contained in:
afc163 2015-07-28 12:26:54 +08:00
parent b7d204967d
commit fb3b16ddc2
2 changed files with 8 additions and 3 deletions

View File

@ -33,7 +33,8 @@ for (let i=0; i<18; i++) {
}
var pagination = {
total: data.length
total: data.length,
current: 2
};
React.render(<Table columns={columns} dataSource={data} pagination={pagination} />

View File

@ -136,9 +136,13 @@ export default React.createClass({
this.props.rowSelection.onSelectAll(checked, selectedRows);
}
},
handlePageChange(current = 1) {
handlePageChange(current) {
let pagination = this.state.pagination || {};
pagination.current = current;
if (current) {
pagination.current = current;
} else {
pagination.current = pagination.current || 1;
}
this.setState({
pagination: pagination
}, this.fetch);