I have to display different pages by reading the page number from the query string. I have tried many option couldn't find any solutions. Please find what i have tried please help.
URL :- http://'localhost'/TestApp/InnerPage.aspx?page=1
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 looping is not possible. I am looking for a way that the JTable can bind with the page number. If any one tried or face this kind of problem please share.
Finally I found the solution by editing the "jquery.jtable.js".
We are assigning the page number to hidden field "hdnPageNumber" and taking the page number from it. This code will effect on all the pages that has referred the JTable. So always check the ".length" condition as shown in the code.
/* 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);
},
Thanks Guys !! Happy coding