update paging

This commit is contained in:
afc163 2015-07-14 16:34:26 +08:00
parent 518bf992ba
commit 17aabfa070
2 changed files with 4 additions and 4 deletions

View File

@ -28,13 +28,12 @@ for (let i=0; i<22; i++) {
data.push({
name: '李大嘴' + i,
age: 32,
address: '西湖区湖底公园' + i + ' 号'
address: '西湖区湖底公园' + i + '号'
});
}
var pagination = {
total: data.length,
pageSize: 10
total: data.length
};
React.render(<Table columns={columns} dataSource={data} pagination={pagination} />

View File

@ -34,7 +34,6 @@ let AntTable = React.createClass({
pagination = false;
} else {
pagination = this.props.pagination || {};
pagination.current = pagination.current || 1;
pagination.pageSize = pagination.pageSize || 10;
}
return {
@ -135,6 +134,8 @@ let AntTable = React.createClass({
}
},
handlePageChange: function(current) {
console.log(current);
current = current || 1;
let pageSize = this.state.pagination.pageSize;
this.setState({
data: this.props.dataSource.filter(function(item, i) {