mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
don't default sort by to first column (#2653)
This commit is contained in:
parent
938e13a429
commit
84fa0d1940
@ -41,7 +41,7 @@ export default class FilterableTable extends PureComponent {
|
|||||||
.reduce((curr, next) => curr + next);
|
.reduce((curr, next) => curr + next);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
sortBy: props.orderedColumnKeys[0],
|
sortBy: null,
|
||||||
sortDirection: SortDirection.ASC,
|
sortDirection: SortDirection.ASC,
|
||||||
fitted: false,
|
fitted: false,
|
||||||
};
|
};
|
||||||
@ -142,9 +142,11 @@ export default class FilterableTable extends PureComponent {
|
|||||||
sortedAndFilteredList = this.list.filter(row => this.hasMatch(filterText, row));
|
sortedAndFilteredList = this.list.filter(row => this.hasMatch(filterText, row));
|
||||||
}
|
}
|
||||||
// sort list
|
// sort list
|
||||||
sortedAndFilteredList = sortedAndFilteredList
|
if (sortBy) {
|
||||||
|
sortedAndFilteredList = sortedAndFilteredList
|
||||||
.sortBy(item => item[sortBy])
|
.sortBy(item => item[sortBy])
|
||||||
.update(list => sortDirection === SortDirection.DESC ? list.reverse() : list);
|
.update(list => sortDirection === SortDirection.DESC ? list.reverse() : list);
|
||||||
|
}
|
||||||
|
|
||||||
const rowGetter = ({ index }) => this.getDatum(sortedAndFilteredList, index);
|
const rowGetter = ({ index }) => this.getDatum(sortedAndFilteredList, index);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user