This commit is contained in:
geek 2018-06-11 22:31:42 +09:00
parent a1b513f766
commit 3db6aa80e6
2 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,7 @@
</ng-template> </ng-template>
<ng-template pTemplate="body" let-target let-rowIndex="rowIndex"> <ng-template pTemplate="body" let-target let-rowIndex="rowIndex">
<tr [pSelectableRow]="target"> <tr [pSelectableRow]="target">
<td>{{rowIndex + 1}}</td> <td>{{(rowIndex + 1) + ((pageIdx - 1) * countPerPage)}}</td>
<td></td> <td></td>
<td>{{target.infra.metaInfraType.name}}</td> <td>{{target.infra.metaInfraType.name}}</td>
<td>{{target.displayName}}</td> <td>{{target.displayName}}</td>
@ -30,7 +30,7 @@
</tr> </tr>
</ng-template> </ng-template>
</p-table> </p-table>
<p-paginator #paginator [rows]="targetPage.size" [totalRecords]="targetPage.totalElements" [first]="pageIdx" <p-paginator #paginator [rows]="targetPage.size" [totalRecords]="targetPage.totalElements" [first]="pageIdx "
(onPageChange)="onPaginate($event)"></p-paginator> (onPageChange)="onPaginate($event)"></p-paginator>
</ng-template> </ng-template>

View File

@ -45,16 +45,18 @@ export class ListComponent implements OnInit, OnChanges {
pending$: Observable<boolean>; pending$: Observable<boolean>;
error$: Observable<any>; error$: Observable<any>;
countPerPage: number;
constructor( constructor(
private store: Store<any>, private store: Store<any>,
private targetService: TargetService, private targetService: TargetService,
private location: PlatformLocation private location: PlatformLocation
) { ) {
this.countPerPage = 2;
} }
ngOnInit() { ngOnInit() {
this.getTargetList(); // this.getTargetList();
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
@ -76,7 +78,7 @@ export class ListComponent implements OnInit, OnChanges {
const pageParams: PageParams = { const pageParams: PageParams = {
pageNo: p, pageNo: p,
countPerPage: 2, countPerPage: this.countPerPage,
sortCol: 'id', sortCol: 'id',
sortDirection: 'descending', sortDirection: 'descending',
}; };