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

pageSize not working

10 Answers 2800 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 04 Sep 2012, 07:09 PM
I am having a problem with the pageSize in the KendoUI Web Control:

Here is a non-working copy using the demo code: Page Size Not Working

Here is a working copy only changing pageable to true without pageSize: Working Paging - No Page Size

I'm wondering how I can get the pageSize dropdown to appear like in this example .

Thanks.

-John-

10 Answers, 1 is accepted

Sort by
0
OnaBai
Top achievements
Rank 2
answered on 04 Sep 2012, 11:04 PM
I cannot see what is working/not working in your examples.
If you want to enable the dropdown select for pagesizes you just need to define pageable: { pageSizes: true }
WARNING: Don't forget that it is plural (ends in an 's')
0
Accepted
David OBrien
Top achievements
Rank 1
answered on 05 Sep 2012, 10:54 AM
Another thing I noticed is your loading jquery 1.7 and 1.8

pageable: {
        numeric: true,
        refresh: true,
        pageSizes: [ 10 , 25, 50 ],
        previousNext: true,
        input: false,
        info: false
},
0
John
Top achievements
Rank 2
answered on 05 Sep 2012, 11:52 AM
Thanks for the responses, I think my jsbin got modified (probably by me :-) ) causing the confusion regarding the working/non-working scenarios.  I was able to get it displayed correctly on the jsbin example.  I still can't get it displayed on my real world example.  I will investigate more, but thank you, David, your's was exactly what I was looking for/expecting... not sure why it is failing locally, probably coder error. :-)
0
David OBrien
Top achievements
Rank 1
answered on 05 Sep 2012, 11:56 AM
I had the exact same question a week or so ago...

http://www.kendoui.com//forums/ui/grid/pager-configuration.aspx

I was using an older copy of the ui locally than was released upgrading fixed my problem

From: Kendo Admin
Date: 8/24/2012 12:03:54 PM
Hi David,

May I ask what KendoUI version you are using? The Kendo pager configuration options was introduced in the latest official release (2012.2.710) and will not work with previous versions of the framework.

I tested your pageable configuration in this fiddle and got everything to work as expected. Could you please check my example and let me know what I am missing.

Regards,
Alexander Valchev 
the Telerik team

0
John
Top achievements
Rank 2
answered on 05 Sep 2012, 12:40 PM
 As you can see in the attached image, I am not getting the dropdown for the pageSize.
Also, the field count is coming back as NaN.  I'm wondering if I should spin this up as a separate thread, but just thought I'd show what the error I'm getting.  I'm wondering if it is a datasource issue and NOT a grid issue.

$el.kendoGrid({
                            columns: columns,
                            height: '490px',
                            selectable: "multiple, row",
                            sortable: true,
                            reorderable: true,
                            filterable: true,
                            resizable: true,
                            columnMenu: true,
                            pageable: {
                                refresh: true,
                                pageSizes: true,
                                previousNext: true,
                                info: true
                            },
                            columnReorder: function (column) { alert('oldIndex:' + column.oldIndex + ' newIndex: ' + column.newIndex); },
                            columnResize: function (column) { alert('oldWidth:' + column.oldWidth + ' newWidth: ' + column.newWidth); },
                            columnHide: function (column) { alert('hide column'); },
                            columnShow: function (column) { alert('show column'); },
                            toolbar: toolbar
                        });
0
OnaBai
Top achievements
Rank 2
answered on 05 Sep 2012, 01:35 PM
I cannot see in your kendoGrid initialization any reference to the DataSource. How do specify it?

I get the same NaN error when I do not specify pageSize *in the DataSource* initialization BUT (at least with the version of KendoUI that I'm using) I get the dropdown with the different page sizes.

Are you using latest versions of KendoUI and jQuery?
0
Anton
Top achievements
Rank 1
answered on 08 Nov 2012, 06:38 PM
I had the same problem:
Normally i use to set pagesize on the grid and not on the datasource, but here to make it work you set on datasource and not grid.
0
Brian
Top achievements
Rank 1
answered on 06 Feb 2013, 08:18 PM
Oh wow, thanks Anton. I figured even if the pageSize of the grid was 0 that should have been fine considering there were 0 items. I went and tried your suggestion and it worked perfectly. Thanks!
0
Jacques
Top achievements
Rank 2
answered on 30 Apr 2015, 02:23 PM
Anyone from Telerik ever answer this because I can still recreate this in the 2015.1.408 release.

That is: getting NaN - NaN of 2 items if I don't set the pageSize on the DataSource. 
0
Kiril Nikolov
Telerik team
answered on 05 May 2015, 08:15 AM

Hello Jacques,

The pageSize and total configurations are required for the pager in order to show correct information, so the behavior that you observe is expected, and the pageSize is required for the pager.

Regards,
Kiril Nikolov
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
John
Top achievements
Rank 2
Answers by
OnaBai
Top achievements
Rank 2
David OBrien
Top achievements
Rank 1
John
Top achievements
Rank 2
Anton
Top achievements
Rank 1
Brian
Top achievements
Rank 1
Jacques
Top achievements
Rank 2
Kiril Nikolov
Telerik team
Share this question
or