mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(table): table column sorting fix
This commit is contained in:
parent
d69788c9df
commit
5d652dcaef
@ -32,6 +32,8 @@ export default class TableModel {
|
|||||||
if (options.desc) {
|
if (options.desc) {
|
||||||
this.rows.reverse();
|
this.rows.reverse();
|
||||||
this.columns[options.col].desc = true;
|
this.columns[options.col].desc = true;
|
||||||
|
} else {
|
||||||
|
this.columns[options.col].desc = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,11 @@ class TablePanelCtrl extends MetricsPanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleColumnSort(col, colIndex) {
|
toggleColumnSort(col, colIndex) {
|
||||||
|
// remove sort flag from current column
|
||||||
|
if (this.table.columns[this.panel.sort.col]) {
|
||||||
|
this.table.columns[this.panel.sort.col].sort = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.panel.sort.col === colIndex) {
|
if (this.panel.sort.col === colIndex) {
|
||||||
if (this.panel.sort.desc) {
|
if (this.panel.sort.desc) {
|
||||||
this.panel.sort.desc = false;
|
this.panel.sort.desc = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user