ing
This commit is contained in:
@@ -50,32 +50,33 @@ export class ListComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getTargetList();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
console.log(changes);
|
||||
if (changes['pageIdx'] && this.paginator) {
|
||||
console.log(this.pageIdx);
|
||||
this.getTargetList();
|
||||
this.paginator.changePage(this.pageIdx);
|
||||
}
|
||||
}
|
||||
|
||||
private getTargetList() {
|
||||
// console.log('----------------------------------------------------------------');
|
||||
// console.log(this.pageIdx);
|
||||
// console.log('----------------------------------------------------------------');
|
||||
|
||||
if (this.pageIdx <= 0 || this.pageIdx === undefined || this.pageIdx === null || isNaN(this.pageIdx)) {
|
||||
this.pageIdx = 0;
|
||||
}
|
||||
const pageParams: PageParams = {
|
||||
pageNo: 0,
|
||||
pageNo: this.pageIdx,
|
||||
countPerPage: 2,
|
||||
sortCol: 'id',
|
||||
sortDirection: 'descending',
|
||||
};
|
||||
|
||||
this.getTargetList(pageParams);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes['pageIdx'] && this.paginator) {
|
||||
const pageParams: PageParams = {
|
||||
pageNo: this.pageIdx,
|
||||
countPerPage: 2,
|
||||
sortCol: 'id',
|
||||
sortDirection: 'descending',
|
||||
};
|
||||
console.log(this.pageIdx);
|
||||
this.paginator.changePage(this.pageIdx);
|
||||
this.getTargetList(pageParams);
|
||||
}
|
||||
}
|
||||
|
||||
private getTargetList(pageParams: PageParams) {
|
||||
|
||||
this.targetService.readAllByProbeID(this.probeID, pageParams)
|
||||
.pipe(
|
||||
tap(() => {
|
||||
|
||||
Reference in New Issue
Block a user