Skip to content

Pagination: pageSize only works when passed in as a String #3924

Open
@jxc876

Description

@jxc876

I followed the documentation and configured the Pagination options.
Below is my code, everything works fine except the pageSize dropdown was not being populated:

$scope.gridOptions = { 
        data: 'rows',
                ...
        // Paging options
        enablePaging : true,
        showFooter: true,
        totalServerItems : 'totalServerItems',
        pagingOptions: {
                pageSizes : [100, 500, 1000],
                pageSize: 100,
                currentPage: 1
            }
        };
  • When I specify pageSize as a number 100 the dropdown doesn't populate.
  • Once I changed it to a string '100', then the dropdown got populated.

I noticed that when I select a different value via the dropdown, and then logged value, it was returning back a String. Wondering if someone forgot to parse the value to an int ?

// console
$scope.gridOptions.pagingOptions.pageSize
"100"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions