Skip to content

Commit

Permalink
#1282, able to clean sorted table manually
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed May 13, 2017
1 parent b611797 commit 261c6ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,13 @@ class BootstrapTable extends Component {
});
}

cleanSort() {
this.store.cleanSortInfo();
this.setState({
reset: false
});
}

handleSort = (order, sortField) => {
if (this.props.options.onSortChange) {
this.props.options.onSortChange(sortField, order, this.props);
Expand Down
4 changes: 4 additions & 0 deletions src/store/TableDataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export class TableDataStore {
}
}

cleanSortInfo() {
this.sortList = [];
}

setSelectedRowKey(selectedRowKeys) {
this.selected = selectedRowKeys;
}
Expand Down

0 comments on commit 261c6ea

Please sign in to comment.