};
Webdiyer.__ajaxPages = {}; //Ajax page parameters, preventing multiple MvcPager with same UrlPageIndexName trigger multiple http requests
Webdiyer.MvcPager = function (wrapper) {
this.wrapper = wrapper;
};
Webdiyer.MvcPager.prototype = {
wrapper: null,
id: null,
urlFormat: null,
pageIndexName: null,
updateTarget: null,
onBegin: null,
onComplete: null,
onFailure: null,
onSuccess: null,
httpMethod: null,
confirm: null,
loadingElementId: null,
loadingDuration: 0,
partialLoading: null,
currentPageIndex: null,
dataFormId: null,
allowCache: true,
enableHistorySupport: null,
//autoSubmitForm: null,
searchCriteria: null,
pageCount: null,
invalidPageErrMsg: null,
outOfRangeErrMsg: null,
firstPageUrl: null,
pageIndexBox: null,
goToButton: null,
maxPageIndexItems: 20,
isAjaxPager: null,
onError: null,
isFirstLoading: true,
allowReload: false, //used by search form to check if reload is needed even current page index is not changed
init: function () {
var wrapper = $(this.wrapper);
var newPageIndex = 1;
var initialPageIndex; //value of the page index when page is loaded first time, if go back to this page we need to load the correct data by checking this value(it's not necessarily to be 1)
this.id = wrapper.attr("id");
this.isAjaxPager = wrapper.data("ajax") || false;
this.pageCount = wrapper.data("pagecount");
this.invalidPageErrMsg = wrapper.data("invalidpageerrmsg");
this.outOfRangeErrMsg = wrapper.data("outrangeerrmsg");
this.firstPageUrl = wrapper.data("firstpage");
this.urlFormat = wrapper.data("urlformat");
this.pageIndexName = wrapper.data("pageparameter");
this.currentPageIndex = wrapper.data("currentpage") || 1;
this.pageIndexBox = wrapper.data("pageindexbox");
this.goToButton = wrapper.data("gotobutton");
this.maxPageIndexItems = wrapper.data("maxitems") || 20;
&