vnTable toggle order only on active field
This commit is contained in:
parent
9527b839df
commit
6450aa8f34
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue