diff --git a/client/core/src/components/th/index.js b/client/core/src/components/th/index.js index d13c85341..86a58993a 100644 --- a/client/core/src/components/th/index.js +++ b/client/core/src/components/th/index.js @@ -2,6 +2,7 @@ import ngModule from '../../module'; export default class Th { constructor($element) { + this._order = 'ASC'; this.column = $element[0]; } @@ -19,7 +20,6 @@ export default class Th { set order(order) { this._order = order; - this.table.setOrder(this.field, order); } @@ -49,7 +49,12 @@ export default class Th { onToggleOrder() { if (!this.field) return; - this.toggleOrder(); + if (this.table.field == this.field) { + this.toggleOrder(); + } else { + this.table.setOrder(this.field, this.order); + } + this.updateArrow(); this.table.applyFilter(this.field, this.order);