diff --git a/packages/react-bootstrap-table2-filter/src/context.js b/packages/react-bootstrap-table2-filter/src/context.js index 0fcfa88..f3edd1f 100644 --- a/packages/react-bootstrap-table2-filter/src/context.js +++ b/packages/react-bootstrap-table2-filter/src/context.js @@ -37,6 +37,14 @@ export default ( } } + componentWillReceiveProps(nextProps) { + if (isRemoteFiltering()) { + this.setState({ + data: nextProps.data + }); + } + } + onFilter(column, filterType, initialize = false) { return (filterVal) => { // watch out here if migration to context API, #334 diff --git a/packages/react-bootstrap-table2-paginator/src/state-context.js b/packages/react-bootstrap-table2-paginator/src/state-context.js index 3b9e7a3..91159f6 100644 --- a/packages/react-bootstrap-table2-paginator/src/state-context.js +++ b/packages/react-bootstrap-table2-paginator/src/state-context.js @@ -52,6 +52,7 @@ class StateProvider extends React.Component { if (this.isRemotePagination() || custom) { this.currPage = nextProps.pagination.options.page; this.currSizePerPage = nextProps.pagination.options.sizePerPage; + this.dataSize = nextProps.pagination.options.totalSize; } } diff --git a/packages/react-bootstrap-table2-toolkit/src/search/context.js b/packages/react-bootstrap-table2-toolkit/src/search/context.js index 11f3b7a..270a15d 100644 --- a/packages/react-bootstrap-table2-toolkit/src/search/context.js +++ b/packages/react-bootstrap-table2-toolkit/src/search/context.js @@ -1,6 +1,7 @@ /* eslint react/prop-types: 0 */ /* eslint react/require-default-props: 0 */ /* eslint no-continue: 0 */ +/* eslint no-lonely-if: 0 */ import React from 'react'; import PropTypes from 'prop-types'; @@ -44,6 +45,10 @@ export default (options = { data: result }); } + } else { + if (isRemoteSearch()) { + this.setState({ data: nextProps.data }); + } } }