mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
parent
b181c98a38
commit
f0fd06a5f5
@ -48,7 +48,9 @@ class ToolkitProvider extends statelessDrcorator(React.Component) {
|
||||
}
|
||||
|
||||
onSearch(searchText) {
|
||||
this.setState({ searchText });
|
||||
if (searchText !== this.state.searchText) {
|
||||
this.setState({ searchText });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -20,25 +20,10 @@ export default (options = {
|
||||
searchText: PropTypes.string
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.needToSearch = true;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.searchText !== this.props.searchText) {
|
||||
this.needToSearch = true;
|
||||
} else {
|
||||
this.needToSearch = false;
|
||||
}
|
||||
}
|
||||
|
||||
search() {
|
||||
const { data, columns } = this.props;
|
||||
let { searchText } = this.props;
|
||||
|
||||
if (!this.needToSearch) return data;
|
||||
|
||||
if (isRemoteSearch()) {
|
||||
handleRemoteSearchChange(searchText);
|
||||
return data;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user