pageSize not working

11 posts, 1 answers
  1. John
    John avatar
    13 posts
    Member since:
    May 2012

    Posted 04 Sep 2012 Link to this post

    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-
  2. OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2012 Link to this post

    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')
  3. Kendo UI is VS 2017 Ready
  4. Answer
    David OBrien
    David OBrien avatar
    19 posts
    Member since:
    Aug 2012

    Posted 05 Sep 2012 Link to this post

    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
    },
  5. John
    John avatar
    13 posts
    Member since:
    May 2012

    Posted 05 Sep 2012 Link to this post

    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. :-)
  6. David OBrien
    David OBrien avatar
    19 posts
    Member since:
    Aug 2012

    Posted 05 Sep 2012 Link to this post

    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

  7. John
    John avatar
    13 posts
    Member since:
    May 2012

    Posted 05 Sep 2012 Link to this post

     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
                            });
  8. OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 05 Sep 2012 Link to this post

    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?
  9. Anton
    Anton avatar
    1 posts
    Member since:
    Feb 2012

    Posted 08 Nov 2012 Link to this post

    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.
  10. Brian
    Brian avatar
    16 posts
    Member since:
    Nov 2012

    Posted 06 Feb 2013 Link to this post

    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!
  11. Jacques
    Jacques avatar
    135 posts
    Member since:
    Jun 2007

    Posted 30 Apr 2015 Link to this post

    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. 
  12. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 05 May 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready