paginations

This commit is contained in:
Michele Artini 2023-02-01 09:33:22 +01:00
parent 6f291aa006
commit 7baa6dcbde
3 changed files with 18 additions and 10 deletions

View File

@ -1,5 +1,11 @@
<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)"
[pageIndex]="currPage"
[pageSize]="pageSize"
@ -9,7 +15,17 @@
aria-label="Select page">
</mat-paginator>
<div *ngFor="let ds of results">
{{ds.name}}
</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>

View File

@ -90,8 +90,6 @@ export class DsmResultsComponent implements OnInit {
}
changePage(event: PageEvent) {
console.log(event.pageIndex);
let path = '/dsm/results/' + event.pageIndex + '/' + event.pageSize;
let qp = this.field ?
{ field: this.field, value: this.value } :

View File

@ -134,15 +134,9 @@ export interface Datasource {
export interface Page<T> {
content: T[],
last: boolean,
first: boolean,
totalPages: number,
totalElements: number,
numberOfElements: number,
size: number,
number: number,
empty:boolean,
pageable?:any,
sort?:any
number: number
}