paginations
This commit is contained in:
parent
6f291aa006
commit
7baa6dcbde
|
@ -1,5 +1,11 @@
|
||||||
<h2>Datasource Manager: Results</h2>
|
<h2>Datasource Manager: Results</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<span *ngIf="field">Searching for <b>{{field}}</b> = <i>"{{value}}"</i></span>
|
||||||
|
<span *ngIf="!field && value">Searching for <i>"{{value}}"</i></span>
|
||||||
|
<span *ngIf="!field && !value">Returning all the datasources</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
<mat-paginator (page)="changePage($event)"
|
<mat-paginator (page)="changePage($event)"
|
||||||
[pageIndex]="currPage"
|
[pageIndex]="currPage"
|
||||||
[pageSize]="pageSize"
|
[pageSize]="pageSize"
|
||||||
|
@ -9,7 +15,17 @@
|
||||||
aria-label="Select page">
|
aria-label="Select page">
|
||||||
</mat-paginator>
|
</mat-paginator>
|
||||||
|
|
||||||
|
|
||||||
<div *ngFor="let ds of results">
|
<div *ngFor="let ds of results">
|
||||||
{{ds.name}}
|
{{ds.name}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<mat-paginator (page)="changePage($event)"
|
||||||
|
[pageIndex]="currPage"
|
||||||
|
[pageSize]="pageSize"
|
||||||
|
[length]="nResults"
|
||||||
|
[pageSize]="pageSize"
|
||||||
|
[pageSizeOptions]="[10, 25, 50, 100]"
|
||||||
|
aria-label="Select page">
|
||||||
|
</mat-paginator>
|
|
@ -90,8 +90,6 @@ export class DsmResultsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
changePage(event: PageEvent) {
|
changePage(event: PageEvent) {
|
||||||
console.log(event.pageIndex);
|
|
||||||
|
|
||||||
let path = '/dsm/results/' + event.pageIndex + '/' + event.pageSize;
|
let path = '/dsm/results/' + event.pageIndex + '/' + event.pageSize;
|
||||||
let qp = this.field ?
|
let qp = this.field ?
|
||||||
{ field: this.field, value: this.value } :
|
{ field: this.field, value: this.value } :
|
||||||
|
|
|
@ -134,15 +134,9 @@ export interface Datasource {
|
||||||
|
|
||||||
export interface Page<T> {
|
export interface Page<T> {
|
||||||
content: T[],
|
content: T[],
|
||||||
last: boolean,
|
|
||||||
first: boolean,
|
|
||||||
totalPages: number,
|
totalPages: number,
|
||||||
totalElements: number,
|
totalElements: number,
|
||||||
numberOfElements: number,
|
|
||||||
size: number,
|
size: number,
|
||||||
number: number,
|
number: number
|
||||||
empty:boolean,
|
|
||||||
pageable?:any,
|
|
||||||
sort?:any
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue