mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-06-28 21:20:04 +00:00
fix remote filter/search broken when pagination enabled
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user