ing
This commit is contained in:
@@ -36,6 +36,7 @@ export class ListComponent implements OnInit, OnChanges {
|
||||
@Input() probeID;
|
||||
@Input() pageIdx;
|
||||
@Output() pageChange = new EventEmitter<number>();
|
||||
@Output() targetSelect = new EventEmitter<Target>();
|
||||
|
||||
@ViewChild('paginator') paginator: Paginator;
|
||||
|
||||
@@ -54,19 +55,15 @@ export class ListComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
console.log(changes);
|
||||
// console.log(changes);
|
||||
if (changes['pageIdx'] && this.paginator) {
|
||||
console.log(this.pageIdx);
|
||||
// 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;
|
||||
}
|
||||
@@ -97,8 +94,7 @@ export class ListComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
onRowSelect(event) {
|
||||
// this.router.navigate(['target'], { queryParams: { target: event.data.id } });
|
||||
// this.router.navigate(['target', event.data.id, 'info']);
|
||||
this.targetSelect.emit(event.data);
|
||||
}
|
||||
|
||||
onAddSensor(target: Target) {
|
||||
|
||||
Reference in New Issue
Block a user