jQWidgets Forums

jQuery UI Widgets Forums Grid Enable paging based on the Rows in a Grid

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 13 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • sushanth009
    Member

    Hello ,

    I am working with the Master Details section and assigning the height of the master grid to 200 . In some cases the inner grid has just 2 rows and in some cases it has 300 rows. So is there a way to enable to enable or disable paging once the grid is initialized.


    Peter Stoev
    Keymaster

    Hi sushanth009,

    Before the Grid initialization, you can bind to the ‘bindingcomplete’ event and turn off the ‘paging’ inside the event handler.

    For example:

                var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").bind('bindingcomplete', function () {
    if (dataAdapter.records.length < 20) {
    $("#jqxgrid").jqxGrid({ pageable: false, autoheight: false });
    }
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    sushanth009
    Member

    Thanks for the reply. The page size seems to change but when the grid is populated it seems to be having 500 rows instead of the 5 . i do not know where I am going wrong. It would be helpful if you can point out the mistake I am committing. Here is my code

    $(grid).bind('bindingcomplete', function() {
    if (detailDataAdapter.records.length > 5) {
    $(grid).jqxGrid({ pageable: true, pagesize: '5', autoheight: false, height: 220 });
    $(grid).jqxGrid({ pagesizeoptions: ['5'] });
    }
    });


    Peter Stoev
    Keymaster

    Hi sushanth009,

    To disable the paging, you need to set the pageable property to false.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.