Skip to content

Commit

Permalink
Tìm kiếm và lọc môn học theo các tùy chọn hoặc từ khóa
Browse files Browse the repository at this point in the history
  • Loading branch information
duykypaul committed Apr 5, 2019
1 parent c793753 commit 7aaf43c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Management/src/app/subjects/list/list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h4 class="card-title">Subjects List</h4>
<div class="row">
<div class="col-sm-6 col-md-4">
<mat-form-field >
<mat-select placeholder="Choosen Status" [(ngModel)]="statusSelect" >
<mat-select placeholder="Choosen Status" [(ngModel)]="statusSelect"
(selectionChange)="filterSubjects()">
<mat-option value="all" >
Choose Status
</mat-option>
Expand Down Expand Up @@ -40,7 +41,8 @@ <h4 class="card-title">Subjects List</h4>
</div>
</div>
<div class="col-sm-6 col-md-4 col-md-offset-4">
<input type="search" class="form-control" placeholder="Search records" [(ngModel)]="keyword">
<input type="search" class="form-control" placeholder="Search records" [(ngModel)]="keyword"
(keyup.enter)="filterSubjects()">
</div>

</div>
Expand Down
5 changes: 5 additions & 0 deletions Management/src/app/subjects/list/list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export class ListComponent implements OnInit {

}


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

setPage(page: number) {
this.pager = this.pagerService.getPager(this.allItems.length, page, +this.tablesLength);
this.pagedItems = this.allItems.slice(this.pager.startIndex, this.pager.endIndex + 1);
Expand Down

0 comments on commit 7aaf43c

Please sign in to comment.