diff --git a/components/table/demo/paging.md b/components/table/demo/paging.md index 03a0249945..7e3d1a58c8 100644 --- a/components/table/demo/paging.md +++ b/components/table/demo/paging.md @@ -35,7 +35,8 @@ for (let i=0; i<46; i++) { var pagination = { total: data.length, - current: 2 + current: 2, + showSizeChanger: true }; React.render( diff --git a/components/table/index.jsx b/components/table/index.jsx index 0d76cf2d01..c69e2f2d7f 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -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; },