Skip to content

Commit

Permalink
Hàm sắp xếp
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyengiangk62uet committed Apr 5, 2019
1 parent b05e4a9 commit 5ffab86
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Management/src/app/exams/list/list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,17 @@ export class ListComponent implements OnInit {
this.getItems(this.subjectSelect, this.statusSelect, this.sortField, this.sortType, this.keyword);
}

/*------------------------SORT--------------------------*/
sortExamsBy(sortField) {
this.sortType = this.sortType == 'asc' ? 'desc' : 'asc';
this.sortField = sortField;

this.getItems(this.subjectSelect, this.statusSelect, this.sortField, this.sortType, this.keyword);
}

displaySortType(sortField) {
if (sortField == this.sortField)
return this.sortType == 'asc' ? 'fa-sort-asc' : 'fa-sort-desc';
return '';
}
}

0 comments on commit 5ffab86

Please sign in to comment.