This is a migrated thread and some comments may be shown as answers.

using function for pageSize: behaves unexpected

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Svetlin
Top achievements
Rank 1
Svetlin asked on 19 Sep 2013, 01:47 AM
I am trying to set the pageSize dynamically. If i do:
localStorage.getItem('pageSize') || 10,

i do not have a problem.

But if i do:
pageSize: function () {           
                    return parseInt(localStorage.getItem('pageSize')) || 10;             
            },

the data-source gets reloaded multiple times and NaN appears on the bottom of the grid - page NaN of 100 instead of 1 of 100


Thanks

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Sep 2013, 07:41 AM
Hi Svetlin,

 The pageSize option cannot be set to a function. It should be set to a number. More info is available in our documentation.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Svetlin
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or