0

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

Osanda Gamage
  • 446
  • 2
  • 6
  • 16
Ajt
  • 1,719
  • 1
  • 20
  • 42

1 Answers1

3

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

ghiscoding
  • 12,308
  • 6
  • 69
  • 112
  • Thanks for the answer..it was typo in the question...sory for that..actualy my input was this.. enablePagination: true, pagination: { pageSizes: [10, 200, 250, 500, 5000], pageSize: 10, }, sir, it is showing like updated in the question.. some other number also showing..Actually i m suing graghql – Ajt Feb 09 '22 at 03:15
  • Sir I am only defined page size in shared module..I am using graphql service...in page size it's also coming default sizes...how to exclude default page size...u only tell wat could be reason..thanks – Ajt Feb 09 '22 at 04:20
  • I found that it is working correctly when set in the grid component but is not when set through the global configs, so it is a bug. You can open a bug in the library and/or set paginations in your grid component for now – ghiscoding Feb 09 '22 at 14:27
  • hope will you fix soon.. Thanks you so much.. https://github.com/ghiscoding/Angular-Slickgrid/issues/879 – Ajt Feb 09 '22 at 15:18
  • i have one more help ..can u pls tel how to get the extra para detail..https://stackoverflow.com/questions/71097344/anguar-slick-grid-get-extraparameter-instance – Ajt Feb 13 '22 at 02:03