Skip to content

Commit 5d652dc

Browse files
committed
fix(table): table column sorting fix
1 parent d69788c commit 5d652dc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

public/app/core/table_model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export default class TableModel {
3232
if (options.desc) {
3333
this.rows.reverse();
3434
this.columns[options.col].desc = true;
35+
} else {
36+
this.columns[options.col].desc = false;
3537
}
3638
}
3739
}

public/app/plugins/panel/table/module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ class TablePanelCtrl extends MetricsPanelCtrl {
120120
}
121121

122122
toggleColumnSort(col, colIndex) {
123+
// remove sort flag from current column
124+
if (this.table.columns[this.panel.sort.col]) {
125+
this.table.columns[this.panel.sort.col].sort = false;
126+
}
127+
123128
if (this.panel.sort.col === colIndex) {
124129
if (this.panel.sort.desc) {
125130
this.panel.sort.desc = false;

0 commit comments

Comments
 (0)