Browse Source

Merge branch master into develop-1.0.0

pull/1319/head
afc163 9 years ago
parent
commit
84b731df0f
  1. 1
      components/table/demo/paging.md
  2. 17
      components/table/index.jsx

1
components/table/demo/paging.md

@ -36,7 +36,6 @@ for (let i = 0; i < 46; i++) {
const pagination = {
total: data.length,
current: 1,
showSizeChanger: true,
onShowSizeChange(current, pageSize) {
console.log('Current: ', current, '; PageSize: ', pageSize);

17
components/table/index.jsx

@ -362,6 +362,7 @@ const Table = React.createClass({
},
handlePageChange(current) {
const props = this.props;
let pagination = { ...this.state.pagination };
if (current) {
pagination.current = current;
@ -372,10 +373,22 @@ const Table = React.createClass({
const newState = {
selectionDirty: false,
pagination
pagination,
};
// Controlled current prop will not respond user interaction
if (props.pagination && 'current' in props.pagination) {
newState.pagination = {
...pagination,
current: this.state.pagination.current,
};
}
this.setState(newState);
this.props.onChange(...this.prepareParamsArguments({ ...this.state, ...newState }));
this.props.onChange(...this.prepareParamsArguments({
...this.state,
selectionDirty: false,
pagination,
}));
},
onRadioChange(ev) {

Loading…
Cancel
Save