Commit 5a8b25e4 authored by Jie Yuan's avatar Jie Yuan

change page size

parent a73f74aa
......@@ -143,7 +143,7 @@
</table>
<mat-paginator [pageSize]="20" [pageSizeOptions]="getPageSizeOptions()" showFirstLastButtons></mat-paginator>
<mat-paginator [pageSize]="40" [pageSizeOptions]="getPageSizeOptions()" showFirstLastButtons></mat-paginator>
</div>
</mat-sidenav-content>
......
......@@ -37,7 +37,7 @@ export class FulltableComponent implements OnInit , DoCheck, AfterViewInit{
gocdbSiteNames: string[];
dpmtSiteNames: string[];
username: string;
defaultPageSizeOptions: number[] =[10,20,40,80];
defaultPageSizeOptions: number[] =[10,20,40,80,160];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
......@@ -385,17 +385,18 @@ getPageSizeOptions(): number[] {
options = [];
for(var i = 0, len = this.defaultPageSizeOptions.length; i < len; i++){
//console.log(this.defaultPageSizeOptions[i]);
if ( this.defaultPageSizeOptions[i] <= real_length) {
if ( this.defaultPageSizeOptions[i] < real_length) {
options.push(this.defaultPageSizeOptions[i]);
} else {
options.push(real_length);
//options.push(real_length);
options.push(this.defaultPageSizeOptions[i]);
break;
}
}
if ( i == this.defaultPageSizeOptions.length) {
options.push(real_length);
}
//if ( i == this.defaultPageSizeOptions.length) {
// options.push(real_length);
//}
//console.log(options);
return options;
......
......@@ -146,7 +146,7 @@
<mat-paginator [pageSize]="20" [pageSizeOptions]="getPageSizeOptions()" showFirstLastButtons></mat-paginator>
<mat-paginator [pageSize]="40" [pageSizeOptions]="getPageSizeOptions()" showFirstLastButtons></mat-paginator>
</div>
</mat-sidenav-content>
......
......@@ -38,7 +38,7 @@ export class TableComponent implements OnInit, DoCheck,AfterViewInit {
dpmtSiteNames: string[];
username: string;
tableLength: number;
defaultPageSizeOptions: number[] =[10,20,40,80];
defaultPageSizeOptions: number[] =[10,20,40,80,160];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
......@@ -339,17 +339,18 @@ getPageSizeOptions(): number[] {
options = [];
for(var i = 0, len = this.defaultPageSizeOptions.length; i < len; i++){
//console.log(this.defaultPageSizeOptions[i]);
if ( this.defaultPageSizeOptions[i] <= real_length) {
if ( this.defaultPageSizeOptions[i] < real_length) {
options.push(this.defaultPageSizeOptions[i]);
} else {
options.push(real_length);
//options.push(real_length);
options.push(this.defaultPageSizeOptions[i]);
break;
}
}
if ( i == this.defaultPageSizeOptions.length) {
options.push(real_length);
}
// if ( i == this.defaultPageSizeOptions.length) {
// options.push(real_length);
//}
//console.log(options);
return options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment