jQWidgets Forums

jQuery UI Widgets Forums Grid Set Page no for a Jqxgrid

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Set Page no for a Jqxgrid #45861

    preetam
    Participant

    Is there any way to set the Page no for a Jqxgrid dynamically?
    I dynamically set the pagesize for a jqxgrid in pageChanged event, so that I can hide the empty rows. But after setting the pagesize, the page no sets to 1. I dont want the page no to be refreshed. This is my code:

    $(“#jqxgridcust”).on(‘pagechanged’, function (event) {
    var datainfo = $(“#jqxgridcust”).jqxGrid(‘getdatainformation’);
    var paginginfo = datainfo.paginginformation;
    var PageNumber = paginginfo.pagenum;
    var countData = 0;
    $.ajax({
    type: “POST”,
    datatype: ‘json’,
    url: ‘@Url.Action(“customerSearchOnPaging”, “Search”)’,
    data: { ‘nxPageNumber’: PageNumber },
    success: function (data) {
    source.localdata = data;
    if (data != null && data != “”) {
    var arrObj = eval(data);
    countData = arrObj.length;
    }
    $(“#jqxgridcust”).jqxGrid(‘updatebounddata’);
    if (countData != 0 && countData < 25)
    $(“#jqxgridcust”).jqxGrid({ pagesize: countData });
    }

    });
    })

    Grid is initialized as:
    virtualmode: true,
    pagesize: 25,
    pagesizeoptions: [’25’],

    Set Page no for a Jqxgrid #45879

    Peter Stoev
    Keymaster

    Hi preetam,

    The “gotopage” method allows you to quickly navigate to a given page. The method expects a page number as parameter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.