angulartypescriptangular-slickgrid

angular slickgrid latest version(Current) pagination not showing properly


This is my code. I am using version 4.1.1

AngularSlickgridModule.forRoot({

          registerExternalResources: [new ExcelExportService()],   
          enableAutoResize: true,
          enableGridMenu: true,
          enableExcelExport:true,
          autoHeight: true,
          alwaysShowVerticalScroll: false,
          autoResize: {
            rightPadding: 10,
            container: '#grid-container',
            bottomPadding: 20,   
            minHeight: 250,
            maxWidth: 900,
            minWidth: 200
          },
         
          enableFiltering: true,
          enablePagination: true,
          pagination: {
            pageSizes: [],
            pageSize: 10,
            totalItems: 0,     
          },
}),

Page size in showing in 10,25,50....100

But I need custom pagination. So I added pageSizes: [10,50,100,1000],

But it showing default pages (except 10) and 1000,2000...

and also not in sort order. Is I'm doing wrong ?

enter image description here

EDIT : After chhange to below code it showing like this..it also showing default page size of slickgrid..

 pagination: {
        pageSizes: [10, 200, 250, 500, 5000],
        pageSize: 10
      },

enter image description here


Solution

  • You have a typo in your page sizes, it won't work with decimal numbers and your pageSize must be a valid number that is included in pageSizes but isn't in your case because of the decimal number, it works fine in the lib as shown by Example 30

    this.gridOptions = {      
      enablePagination: true,
      pagination: {
        pageSize: 10,
        pageSizes: [10, 200, 250, 500, 5000]
      },
    };
    

    pagination page sizes

    EDIT

    There was actually a bug identified to set pagination via global configuration and that was fixed and released under a patch version 4.1.2 of Angular-Slickgrid