Skip to content

Commit

Permalink
separate search & column filter hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Nov 7, 2015
1 parent dd807c3 commit eccb61d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ class BootstrapTable extends React.Component {
} else {
result = this.store.get();
}
if(this.props.options.afterColumnFilter)
this.props.options.afterColumnFilter(filterObj,
this.store.getDataIgnoringPagination());
this.setState({
data: result
});
Expand All @@ -413,6 +416,8 @@ class BootstrapTable extends React.Component {
} else {
result = this.store.get();
}
if(this.props.options.afterSearch)
this.props.options.afterSearch(searchText, this.store.getDataIgnoringPagination());
this.setState({
data: result
});
Expand Down Expand Up @@ -547,6 +552,8 @@ BootstrapTable.propTypes = {
afterTableComplete: React.PropTypes.func,
afterDeleteRow: React.PropTypes.func,
afterInsertRow: React.PropTypes.func,
afterSearch: React.PropTypes.func,
afterColumnFilter: React.PropTypes.func,
onRowClick: React.PropTypes.func,
page: React.PropTypes.number,
sizePerPageList: React.PropTypes.array,
Expand Down Expand Up @@ -596,6 +603,8 @@ BootstrapTable.defaultProps = {
afterTableComplete: undefined,
afterDeleteRow: undefined,
afterInsertRow: undefined,
afterSearch: undefined,
afterColumnFilter: undefined,
onRowClick: undefined,
page: 1,
sizePerPageList: Const.SIZE_PER_PAGE_LIST,
Expand Down

0 comments on commit eccb61d

Please sign in to comment.