diff options
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation')
2 files changed, 12 insertions, 6 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html index 70b1644ab..82010db1c 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html @@ -149,12 +149,13 @@ <span>({{resourceDictionaryRes.length}} attributes in total)</span> </div> </div> - <mat-paginator [pageSizeOptions]="[10, 25,50, 100]"></mat-paginator> + <mat-paginator [pageSizeOptions]="[10, 25,50, 100,this.resourceDictionaryRes.length]"> + </mat-paginator> <mat-form-field class="tableFilter float-right"> <mat-label>Filter</mat-label> <input matInput (keyup)="initApplyFilter($event)" placeholder="Ex. Mia" #input> </mat-form-field> - <table mat-table [dataSource]="initDataSource" matSort> + <table mat-table matSortDisableClear [dataSource]="initDataSource" matSort> <!-- select Column --> <ng-container matColumnDef="select"> <th mat-header-cell *matHeaderCellDef> </th> @@ -262,8 +263,8 @@ <mat-label>Filter</mat-label> <input matInput (keyup)="applyFilter($event)" placeholder="Ex. Mia" #input> </mat-form-field> - <mat-paginator [pageSizeOptions]="[10, 25,50, 100]"></mat-paginator> - <table mat-table [dataSource]="dataSource" matSort> + <mat-paginator #paginate="matPaginator" [pageSizeOptions]="[10, 25,50, 100]"></mat-paginator> + <table matSortDisableClear mat-table [dataSource]="dataSource" #sort="matSort" matSort> <!-- Required Column --> <ng-container matColumnDef="Required"> <th mat-header-cell *matHeaderCellDef> Required </th> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts index 0bf4d9c54..a26f3b90e 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts @@ -74,8 +74,8 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy, AfterViewI dataSource: MatTableDataSource<{}>; initDataSource: MatTableDataSource<{}>; // dataSource = new MatTableDataSource(); - @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; - @ViewChild(MatSort, { static: true }) sort: MatSort; + @ViewChild('paginate', { static: true }) paginator: MatPaginator; + @ViewChild('sort', { static: true }) sort: MatSort; @ViewChild(MatPaginator, { static: true }) initPaginator: MatPaginator; @ViewChild(MatSort, { static: true }) initSort: MatSort; @@ -519,6 +519,11 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy, AfterViewI rerender(): void { this.initDataSource = new MatTableDataSource(this.resourceDictionaryRes); // this.cdr.detectChanges(); + /* + Hint: the intial page size for the table will be the result size; I did that because the table doesn't load element in DOM, + as result some function are not working well like save and you have to move to other pages to fix that. + */ + this.initPaginator.pageSize = this.resourceDictionaryRes.length; this.initDataSource.paginator = this.initPaginator; this.initDataSource.sort = this.initSort; } |