mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 06:06:01 +00:00
multiple sort criteria #235
This commit is contained in:
@@ -372,6 +372,22 @@ export abstract class GridDisplay {
|
||||
this.reload();
|
||||
}
|
||||
|
||||
addToSort(uniqueName, order) {
|
||||
this.setConfig(cfg => ({
|
||||
...cfg,
|
||||
sort: [...(cfg.sort || []), { uniqueName, order }],
|
||||
}));
|
||||
this.reload();
|
||||
}
|
||||
|
||||
clearSort() {
|
||||
this.setConfig(cfg => ({
|
||||
...cfg,
|
||||
sort: [],
|
||||
}));
|
||||
this.reload();
|
||||
}
|
||||
|
||||
setGrouping(uniqueName, groupFunc: GroupFunc) {
|
||||
this.setConfig(cfg => ({
|
||||
...cfg,
|
||||
@@ -408,6 +424,15 @@ export abstract class GridDisplay {
|
||||
return this.config.sort.find(x => x.uniqueName == uniqueName)?.order;
|
||||
}
|
||||
|
||||
getSortOrderIndex(uniqueName) {
|
||||
if (this.config.sort.length <= 1) return -1;
|
||||
return _.findIndex(this.config.sort, x => x.uniqueName == uniqueName);
|
||||
}
|
||||
|
||||
isSortDefined() {
|
||||
return (this.config.sort || []).length > 0;
|
||||
}
|
||||
|
||||
get filterCount() {
|
||||
return _.compact(_.values(this.config.filters)).length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user