JTable Pagination from Query String Value

I need to display different pages by reading the page number from the query string. I tried many options, could not find any solutions. Please find what I tried, please help.

URL: - http: //'localhost'/TestApp/InnerPage.aspx? page = 1

The code: -

/*tried to loop through the classes*/
var classList = $('.jtable-page-list');
$.each(classList, function (index, item) {
   alert(this.innerHTML);
});

/*binding the jTable*/
$('#divJTableContainer').jtable('load', {
    Name: $('#txtClient').val(),
    RefNo: $('#txtrefNo').val(),
    Email: $('#txtEmailid').val(),
    Phone: $('#txtPhoneNumber').val(),
    InsuredZip: $('#txtZipCode').val(),
    AppDate: $('#txtStartDate').val(),
    EffectiveDate: $('#txtToDate').val(),
    Status: $('#ddlStatus').val()
 });

The class name is not even in the source, so a loop is not possible. I am looking for a way in which a JTable can communicate with a page number. If someone has tried or encountered similar problems, please share.

+4
source share
1 answer

Finally, I found a solution by editing "jquery.jtable.js".

"hdnPageNumber" . , JTable. ".length", .

    /* Overrides load method to set current page to 1.
    *************************************************************************/
    load: function () {
        /*
        Manual code added by Navajyoth.C.S on 19-09-2014
        */
        if ($('#hdnPageNumber').length > 0) {
            if ($('#hdnPageNumber').val() != "") {
                this._currentPageNo = parseInt($('#hdnPageNumber').val());
            }
            else {
                this._currentPageNo = 1;
            }
        }
        else {
            this._currentPageNo = 1;
        }

        /*
        Commenting the old code
          this._currentPageNo = 1;
        */
        base.load.apply(this, arguments);
    },

, !

+2

All Articles