Skip to content

Commit

Permalink
fix(stark-ui): table - Multisort - fix order issue when adding/removi…
Browse files Browse the repository at this point in the history
…ng sort criteria

ISSUES CLOSED: #1478
  • Loading branch information
SuperITMan committed Jan 14, 2020
1 parent b157a68 commit d113d05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<mat-icon *ngSwitchCase="'desc'" svgIcon="arrow-down" class="stark-small-icon"></mat-icon>
<mat-icon class="order-tip stark-small-icon" *ngSwitchDefault svgIcon="arrow-up"></mat-icon>
</ng-container>
<span *ngIf="sortPriority < 1000 && sortDirection" class="priority">{{ sortPriority }}</span>
<span *ngIf="sortPriority < 100 && sortDirection" class="priority">{{ sortPriority }}</span>
</div>
<button *ngIf="filterable" class="button-filter" [matMenuTriggerFor]="filterMenu" mat-icon-button>
<mat-icon class="stark-small-icon" svgIcon="filter" [matTooltip]="'STARK.TABLE.COLUMN_FILTER' | translate"></mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class StarkTableColumnComponent extends AbstractStarkUiComponent implemen
* Priority of the column.
*/
@Input()
public sortPriority = 0;
public sortPriority = 100;

/**
* Whether the column is visible or not. Default: true
Expand Down Expand Up @@ -253,6 +253,10 @@ export class StarkTableColumnComponent extends AbstractStarkUiComponent implemen
) {
this._filterFormCtrl.setValue(this.filterValue);
}

if (simpleChanges["sortPriority"] && typeof simpleChanges["sortPriority"].currentValue === "undefined") {
this.sortPriority = 100;
}
}

/**
Expand Down

0 comments on commit d113d05

Please sign in to comment.