mirror of https://github.com/apache/superset.git
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);
|
||||
|
||||
this.state = {
|
||||
sortBy: props.orderedColumnKeys[0],
|
||||
sortBy: null,
|
||||
sortDirection: SortDirection.ASC,
|
||||
fitted: false,
|
||||
};
|
||||
|
@ -142,9 +142,11 @@ export default class FilterableTable extends PureComponent {
|
|||
sortedAndFilteredList = this.list.filter(row => this.hasMatch(filterText, row));
|
||||
}
|
||||
// sort list
|
||||
sortedAndFilteredList = sortedAndFilteredList
|
||||
if (sortBy) {
|
||||
sortedAndFilteredList = sortedAndFilteredList
|
||||
.sortBy(item => item[sortBy])
|
||||
.update(list => sortDirection === SortDirection.DESC ? list.reverse() : list);
|
||||
}
|
||||
|
||||
const rowGetter = ({ index }) => this.getDatum(sortedAndFilteredList, index);
|
||||
|
||||
|
|
Loading…
Reference in New Issue