mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-07-01 14:40:02 +00:00
fixes sorting issue (#354)
+ when remote sort is true then disable client side sorting
This commit is contained in:
@@ -39,15 +39,17 @@ export default Base =>
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
let sortedColumn;
|
||||
for (let i = 0; i < nextProps.columns.length; i += 1) {
|
||||
if (nextProps.columns[i].dataField === nextProps.store.sortField) {
|
||||
sortedColumn = nextProps.columns[i];
|
||||
break;
|
||||
if (!this.isRemoteSort() && !this.isRemotePagination()) {
|
||||
let sortedColumn;
|
||||
for (let i = 0; i < nextProps.columns.length; i += 1) {
|
||||
if (nextProps.columns[i].dataField === nextProps.store.sortField) {
|
||||
sortedColumn = nextProps.columns[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sortedColumn && sortedColumn.sort) {
|
||||
nextProps.store.sortBy(sortedColumn);
|
||||
}
|
||||
}
|
||||
if (sortedColumn && sortedColumn.sort) {
|
||||
nextProps.store.sortBy(sortedColumn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user