template.js.base.grid.base.min.js Maven / Gradle / Ivy
/*
jqGrid 4.15.5 - free jqGrid: https://github.com/free-jqgrid/jqGrid
Copyright (c) 2008-2014, Tony Tomov, [email protected]
Copyright (c) 2014-2018, Oleg Kiriljuk, [email protected]
Dual licensed under the MIT and GPL licenses
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl-2.0.html
Date: 2018-08-13
*/
'use strict';(function(c,I){"function"===typeof define&&define.amd?define(["jquery"],function(ha){return I(ha,c.document)}):"object"===typeof module&&module.exports?module.exports=function(c,q){c||(c=window);void 0===q&&(q="undefined"!==typeof window?require("jquery"):require("jquery")(c));I(q,c.document);return q}:I(jQuery,c.document)})("undefined"!==typeof window?window:this,function(c,I){var ha={name:"English (United States)",nameEnglish:"English (United States)",isRTL:!1,defaults:{recordtext:"View {0} - {1} of {2}",
emptyrecords:"No records to view",loadtext:"Loading...",pgtext:"Page {0} of {1}",pgfirst:"First Page",pglast:"Last Page",pgnext:"Next Page",pgprev:"Previous Page",pgrecs:"Records per Page",showhide:"Toggle Expand Collapse Grid",savetext:"Saving..."},search:{caption:"Search...",Find:"Find",Reset:"Reset",odata:[{oper:"eq",text:"equal"},{oper:"ne",text:"not equal"},{oper:"lt",text:"less"},{oper:"le",text:"less or equal"},{oper:"gt",text:"greater"},{oper:"ge",text:"greater or equal"},{oper:"bw",text:"begins with"},
{oper:"bn",text:"does not begin with"},{oper:"in",text:"is in"},{oper:"ni",text:"is not in"},{oper:"ew",text:"ends with"},{oper:"en",text:"does not end with"},{oper:"cn",text:"contains"},{oper:"nc",text:"does not contain"},{oper:"nu",text:"is null"},{oper:"nn",text:"is not null"}],groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],addGroupTitle:"Add subgroup",deleteGroupTitle:"Delete group",addRuleTitle:"Add rule",deleteRuleTitle:"Delete rule",operandTitle:"Click to select search operation.",resetTitle:"Reset Search Value"},
edit:{addCaption:"Add Record",editCaption:"Edit Record",bSubmit:"Submit",bCancel:"Cancel",bClose:"Close",saveData:"Data has been changed! Save changes?",bYes:"Yes",bNo:"No",bExit:"Cancel",msg:{required:"Field is required",number:"Please, enter valid number",minValue:"value must be greater than or equal to ",maxValue:"value must be less than or equal to",email:"is not a valid e-mail",integer:"Please, enter valid integer value",date:"Please, enter valid date value",url:"is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined:" is not defined!",novalue:" return value is required!",customarray:"Custom function should return array!",customfcheck:"Custom function should be present in case of custom checking!"}},view:{caption:"View Record",bClose:"Close"},del:{caption:"Delete",msg:"Delete selected record(s)?",bSubmit:"Delete",bCancel:"Cancel"},nav:{edittext:"",edittitle:"Edit selected row",addtext:"",addtitle:"Add new row",deltext:"",deltitle:"Delete selected row",searchtext:"",searchtitle:"Find records",refreshtext:"",
refreshtitle:"Reload Grid",alertcap:"Warning",alerttext:"Please, select row",viewtext:"",viewtitle:"View selected row",savetext:"",savetitle:"Save row",canceltext:"",canceltitle:"Cancel row editing"},col:{caption:"Select columns",bSubmit:"Ok",bCancel:"Cancel"},errors:{errcap:"Error",nourl:"No url is set",norecords:"No records to process",model:"Length of colNames \x3c\x3e colModel!"},formatter:{integer:{thousandsSeparator:",",defaultValue:"0"},number:{decimalSeparator:".",thousandsSeparator:",",decimalPlaces:2,
defaultValue:"0.00"},currency:{decimalSeparator:".",thousandsSeparator:",",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0.00"},date:{dayNames:"Sun Mon Tue Wed Thr Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" "),AmPm:["am","pm","AM","PM"],S:function(c){var b=["st","nd","rd","th"];return 11>c||13 /g,"\x26gt;"):c},oldEncodePostedData:function(c){return c?String(c).replace(/&/g,"\x26amp;").replace(/"/g,"\x26quot;").replace(//g,"\x26gt;"):c},oldDecodePostedData:function(c){return c&&("\x26nbsp;"===c||"\x26#160;"===c||1===c.length&&160===c.charCodeAt(0))?"":c?String(c).replace(/>/g,"\x3e").replace(/</g,"\x3c").replace(/"/g,'"').replace(/&/g,"\x26"):c},clearArray:function(c){for(;0])*>/gi,""))&&"\x26nbsp;"!==c&&"\x26#160;"!==c?c.replace(/"/g,"'"):"":c},stripPref:function(d,
b){var e=c.type(d);if("string"===e||"number"===e)d=String(d),b=""!==d?String(b).replace(String(d),""):b;return b},getRes:function(c,b){b=b.split(".");var d=b.length,f;if(null!=c){for(f=0;fh&&(b[g]=h+1,l.m=b[g]);break;case "F":h=c.inArray(b[g],f.monthNames,12);-1!==h&&11h&&b[g]===f.AmPm[h]&&(b[g]=h,l.h=n(b[g],l.h));break;case "A":h=
c.inArray(b[g],f.AmPm),-1!==h&&1=d?l.y=1900+l.y:0<=d&&69>=d&&(l.y=2E3+l.y);l=new Date(l.y,l.m,l.d,l.h,l.i,l.s,l.u);0!==m&&l.setTime(Number(Number(l)+6E4*m))}else l=new Date(parseFloat(b));else l=new Date(1E3*parseFloat(b));else l=new Date(l.y,l.m,l.d,l.h,l.i,l.s,l.u);f.userLocalTime&&
0===m&&(m-=(new Date).getTimezoneOffset(),0!==m&&l.setTime(Number(Number(l)+6E4*m)));if(void 0===e)return l;f.masks.hasOwnProperty(e)?e=f.masks[e]:e||(e="Y-m-d");if("u1000"===e.toLowerCase())return l.getTime();m=l.getHours();d=l.getMinutes();b=l.getDate();n=l.getMonth()+1;h=l.getTimezoneOffset();g=l.getSeconds();k=l.getMilliseconds();var x=l.getDay(),t=l.getFullYear(),r=(x+6)%7+1,C=(new Date(t,n-1,b)-new Date(t,0,1))/864E5,D=5>r?Math.floor((C+r-1)/7)+1:Math.floor((C+r-1)/7)||(4>((new Date(t-1,0,1)).getDay()+
6)%7?53:52),z={d:p(b),D:f.dayNames[x],j:b,l:f.dayNames[x+7],N:r,S:f.S(b),w:x,z:C,W:D,F:f.monthNames[n-1+12],m:p(n),M:f.monthNames[n-1],n:n,t:"?",L:"?",o:"?",Y:t,y:String(t).substring(2),a:12>m?f.AmPm[0]:f.AmPm[1],A:12>m?f.AmPm[2]:f.AmPm[3],B:"?",g:m%12||12,G:m,h:p(m%12||12),H:p(m),i:p(d),s:p(g),u:k,e:"?",I:"?",O:(0?@\[\\\]\^`{|}~]/g,"\\$\x26")},getGridComponentId:function(c){if(null==this.p||!this.p.id)return"";var b=this.p.id;switch(c){case 21:return b;
case 0:return"gbox_"+b;case 8:return"gview_"+b;case 3:return"alertmod_"+b;case 43:return"rs_m"+b;case 45:return"cb_"+b;case 46:return"sopt_menu";default:return""}},getGridComponentIdSelector:function(c){return(c=q.getGridComponentId.call(this,c))?"#"+q.jqID(c):""},isHTMLElement:function(c){return"object"===typeof HTMLElement||"function"===typeof HTMLElement?c instanceof HTMLElement:null!=c&&"object"===typeof c&&1===c.nodeType&&"string"===typeof c.nodeName},getGridComponent:function(d,b){var e;if(b instanceof
c||0b?e:0;k||"number"===typeof c||"number"===typeof b||(c=String(c),b=String(b));return cb?e:0};this._performSort=function(){0!==D.length&&(g=e._doSort(g,0))};this._doSort=function(c,b){var d=D[b].by,f=D[b].dir,g=D[b].type,a=D[b].datefmt,l=D[b].sfunc;if(b===D.length-1)return e._getOrder(c,d,f,g,a,l);b++;c=e._getGroup(c,d,f,g,a);d=[];for(f=0;ff.length)return null;var g="on"===f.substring(0,2)?"jqGrid"+b+f.charAt(2).toUpperCase()+f.substring(3):"jqGrid"+b+f.charAt(0).toUpperCase()+f.substring(1),k=c.makeArray(arguments).slice(4),l=d[f+e];k.unshift(g);k.unshift(l);return q.fullBoolFeedback.apply(h,k)},builderSortIcons:function(d){var b=this,e=b.p,f=c(b),h=f.jqGrid("getGuiStyles","states.disabled"),g=function(g){var l=e.colModel[d],k=null!=l&&c.isFunction(l.sortIconName)?l.sortIconName:
e.sortIconName,l=c.isFunction(k)?k.call(b,{order:g,iCol:d,cm:l}):f.jqGrid("getIconRes","sort."+g);return q.mergeCssClasses("ui-grid-ico-sort","ui-icon-"+g,"horizontal"===e.viewsortcols[1]?"ui-i-"+g:"",h,l,"ui-sort-"+e.direction)};return"\x3cspan class\x3d's-ico"+(e.sortIconsBeforeText?" jqgrid-icons-first":"")+"' style\x3d'display:none'\x3e\x3cspan class\x3d'"+g("asc")+"'\x3e\x3c/span\x3e\x3cspan class\x3d'"+g("desc")+"'\x3e\x3c/span\x3e\x3c/span\x3e"},builderFmButon:function(d,b,e,f,h){var g=this.p,
k=c(this);return null==g?"":"\x3ca id\x3d'"+d+"' class\x3d'"+q.mergeCssClasses("fm-button",k.jqGrid("getGuiStyles","dialog.fmButton"),k.jqGrid("getGuiStyles","dialog."+("right"===h?"rightCorner":"left"===h?"leftCorner":"defaultCorner")),"right"===f?"fm-button-icon-right":"left"===f?"fm-button-icon-left":"")+"' role\x3d'button' tabindex\x3d'0'\x3e"+(e?"\x3cspan class\x3d'fm-button-icon "+(k.jqGrid("getIconRes",e)||e)+"'\x3e\x3c/span\x3e":"")+(b?"\x3cspan class\x3d'fm-button-text'\x3e"+b+"\x3c/span\x3e":
"")+"\x3c/a\x3e"},convertOnSaveLocally:function(d,b,e,f,h,g){if(null==this.p)return d;if(c.isFunction(b.convertOnSave))return b.convertOnSave.call(this,{newValue:d,cm:b,oldValue:e,id:f,item:h,iCol:g});if("boolean"!==typeof e&&"number"!==typeof e)return d;"boolean"!==typeof e||"checkbox"!==b.edittype&&"checkbox"!==b.formatter?"number"!==typeof e||isNaN(d)||("number"===b.formatter||"currency"===b.formatter?d=parseFloat(d):"integer"===b.formatter&&(d=parseInt(d,10))):(e=String(d).toLowerCase(),b=null!=
b.editoptions&&"string"===typeof b.editoptions.value?b.editoptions.value.split(":"):["yes","no"],0<=c.inArray(e,["1","true",b[0].toLowerCase()])?d=!0:0<=c.inArray(e,["0","false",b[1].toLowerCase()])&&(d=!1));return d},parseDataToHtml:function(d,b,e,f,h,g,k){var l=this,m=l.p,p=c(l),n,x,t,r,C,D,z,y=!1,u=[],w=[],B=!0!==m.altRows||p.jqGrid("isBootstrapGuiStyle")?"":m.altclass,A=m.groupingView,a=!1,E=parseInt(m.rowNum,10),J,F=c.fn.jqGrid,P=!0===m.treeGrid&&-1=P&&(m.rowIndexes={});if("local"===m.datatype&&!m.deselectAfterSort||m.multiPageSelection)y=!0;g&&(E*=g+1);for(g=0;gm.maxItemsToJoin&&(u=[u.join("")])}m.grouping&&F.groupingRender&&(k&&(A._locgr=!0),u=[F.groupingRender.call(p,w,E)],q.clearArray(w));return u},fillSelectOptions:function(d,b,e,f,h,g){var k,l=[],m,p,n=!1;p=function(c,b){if(0]*>([\s\S]*)<\/body\s*>/gim.exec(a);b.innerHTML=null!=e&&2===e.length?e[1]:a;a=b.getElementsByTagName("script");for(e=a.length;e--;)a[e].parentNode.removeChild(a[e]);a=b.innerHTML;try{""===c.trim(c(a).text())&&(a="")}catch(Xa){}return a},l=function(a){try{var b=
c.parseJSON(a),e=[],d;for(d in b)b.hasOwnProperty(d)&&"StackTrace"!==d&&e.push(d+": "+b[d]);a=e.join("\x3cbr /\x3e")}catch(Ya){}return a};"text/html"===d?f=g(f):"application/json"===d?f=l(f):"text/plain"===d&&(f=l(f));500!==a.status&&0!==a.status&&(f=(b||e)+(e&&e!==b?": "+e:"")+" "+a.status+" "+a.statusText+(""!==f?"\x3chr /\x3e":"")+f);k.jqGrid("displayErrorMessage",f||b||e)}},loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,beforeProcessing:null,onHeaderClick:null,viewrecords:!1,loadonce:!1,
forceClientSorting:!1,multiselect:!1,multikey:!1,editurl:"clientArray",search:!1,caption:"",hidegrid:!0,hiddengrid:!1,useUnformattedDataForCellAttr:!0,postData:{},userData:{},treeGrid:!1,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",filters:"filters",nd:"nd",id:"id",idold:"idOld",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},
forceFit:!1,gridstate:"visible",cellEdit:!1,iCol:-1,iRow:-1,nv:0,loadui:"enable",toolbar:[!1,""],scroll:!1,multiboxonly:!1,deselectAfterSort:!0,resetPageAfterSort:!0,multiPageSelection:!1,selectAllMode:"filtered",scrollrows:!1,autowidth:!1,scrollOffset:18,cellLayout:5,subGridWidth:16,multiselectWidth:16,multiselectPosition:"left",gridview:!0,rownumWidth:25,rownumbers:!1,pagerpos:"center",footerrow:!1,userDataOnFooter:!1,hoverrows:!0,altclass:"ui-priority-secondary",viewsortcols:[!1,"vertical",!0],
resizeclass:"",autoencode:!0,autoEncodeOnEdit:!1,remapColumns:[],cmNamesInputOrder:[],ajaxGridOptions:{},direction:y,toppager:!1,headertitles:!1,scrollTimeout:40,maxItemsToJoin:32768,data:[],lastSelectedData:[],quickEmpty:"quickest",_index:{},indexByColumnData:{},dataIndexById:{},iColByName:{},iPropByName:{},reservedColumnNames:["rn","cb","subgrid"],grouping:!1,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:!1,useDefaultValuesOnGrouping:!0,
summary:[],displayField:[],groupSummaryPos:[],formatDisplayField:[],_locgr:!1,commonIconClass:B("grouping.common"),plusicon:B("grouping.plus"),minusicon:B("grouping.minus")},ignoreCase:!0,cmTemplate:{},idPrefix:"",iconSet:u,guiStyle:w,locale:z,multiSort:!1,showSortOrder:!0,sortOrderPosition:"afterSortIcons",multiSortOrder:"lastClickedFirstSorted",maxSortColumns:3,treeIcons:{commonIconClass:B("treeGrid.common"),plusLtr:B("treeGrid.plusLtr"),plusRtl:B("treeGrid.plusRtl"),minus:B("treeGrid.minus"),leaf:B("treeGrid.leaf")}},
O,{navOptions:p(!0,{commonIconClass:B("nav.common"),editicon:B("nav.edit"),addicon:B("nav.add"),delicon:B("nav.del"),searchicon:B("nav.search"),refreshicon:B("nav.refresh"),viewicon:B("nav.view"),saveicon:B("nav.save"),cancelicon:B("nav.cancel"),buttonicon:B("nav.newbutton")},q.nav||{}),actionsNavOptions:p(!0,{commonIconClass:B("actions.common"),editicon:B("actions.edit"),delicon:B("actions.del"),saveicon:B("actions.save"),cancelicon:B("actions.cancel")},q.actionsNav||{}),formEditing:p(!0,{commonIconClass:B("form.common"),
prevIcon:B("form.prev"),nextIcon:B("form.next"),saveicon:[!0,"left",B("form.save")],closeicon:[!0,"left",B("form.undo")]},q.edit||{}),searching:p(!0,{commonIconClass:B("search.common"),findDialogIcon:B("search.search"),resetDialogIcon:B("search.reset"),queryDialogIcon:B("search.query")},q.search||{}),formViewing:p(!0,{commonIconClass:B("form.common"),prevIcon:B("form.prev"),nextIcon:B("form.next"),closeicon:[!0,"left",B("form.cancel")]},q.view||{}),formDeleting:p(!0,{commonIconClass:B("form.common"),
delicon:[!0,"left",B("form.del")],cancelicon:[!0,"left",B("form.cancel")]},q.del||{})},d||{}),E=function(c){var b=q.getRes(a,c);return void 0!==b?b:C.call(k,"defaults."+c)};a.recordpos=a.recordpos||("rtl"===a.direction?"left":"right");a.autoResizing.widthOfVisiblePartOfSortIcon=void 0!==a.autoResizing.widthOfVisiblePartOfSortIcon?a.autoResizing.widthOfVisiblePartOfSortIcon:"fontAwesome"===a.iconSet?13:12;a.datatype=void 0!==a.datatype?a.datatype:void 0!==h||null==a.url?"local":null!=a.jsonReader&&
"object"===typeof a.jsonReader?"json":"xml";a.jsonReader=a.jsonReader||{};a.url=a.url||"";a.cellsubmit=void 0!==a.cellsubmit?a.cellsubmit:void 0===a.cellurl?"clientArray":"remote";a.gridview=void 0!==a.gridview?a.gridview:null==a.afterInsertRow;void 0!==h&&(a.data=h,d.data=h);void 0!==g&&(a.datastr=g,d.datastr=g);if("TABLE"!==e.tagName.toUpperCase())D("Element is not a table!");else if(""===e.id&&k.attr("id",X()),void 0!==I.documentMode&&5>=I.documentMode)D("Grid can not be used in this ('quirks') mode!");
else{k.empty().attr("tabindex","0");e.p=a;a.id=e.id;a.idSel="#"+F(e.id);a.gBoxId=wa.call(e,0);a.gBox=va.call(e,0);a.gViewId=wa.call(e,8);a.gView=va.call(e,8);a.rsId=wa.call(e,43);a.rs=va.call(e,43);a.cbId=wa.call(e,45);a.cb=va.call(e,45);var ja=q.fixScrollOffsetAndhBoxPadding,da=function(a){var c={},b,e=a.length;for(b=0;bl&&(null==this.curGbox&&(this.curGbox=c(a.rs)),this.curGbox.css({left:e.sOL+d}),!0===a.forceFit?(e=f[e.idx+a.nv],d="ltr"===a.direction?e.width-d:e.width+d,d>a.autoResizing.minColWidth&&(b.newWidth=g,e.newWidth=d)):(this.newWidth="ltr"===a.direction?a.tblwidth+d:a.tblwidth-d,b.newWidth=g))}},resizeColumn:function(e,d,f){var g=this.headers,l=this.footers,k=g[e],h=k.newWidth||k.width,G=ka(21,this.bDiv),H=ka(14,this.hDiv).children("thead").children("tr").first()[0].cells,
h=parseInt(h,10);a.colModel[e].width=h;k.width=h;H[e].style.width=h+"px";this.cols[e].style.width=h+"px";this.fbRows&&(c(this.fbRows[0].cells[e]).css("width",h),c(ka(31,this.fhDiv)[0].rows[0].cells[e]).css("width",h),a.footerrow&&c(ka(36,this.fsDiv)[0].rows[0].cells[e]).css("width",h));0=h&&(void 0===a.lastpage||(parseInt((e+f+k-1)/k,10)||0)<=a.lastpage)&&(p=parseInt((g-e+k-1)/k,10)||1,0<=e||2>p||!0===a.scroll?(m=(Math.round((e+f)/k)||0)+1,h=-1):h=1);0a.lastpage||1===a.lastpage||m===a.page&&m===a.lastpage)||
(d.hDiv.loading?d.timer=setTimeout(function(){d.populateVisible.call(b)},a.scrollTimeout):(a.page=m,n&&(d.selectionPreserver.call(b),d.emptyRows.call(b,!1,!1)),d.populate.call(b,p)))}}},scrollGrid:function(){if(a.scroll){var c=this.scrollTop;void 0===v.scrollTop&&(v.scrollTop=0);c!==v.scrollTop&&(v.scrollTop=c,v.timer&&clearTimeout(v.timer),v.timer=setTimeout(function(){v.populateVisible.call(e)},a.scrollTimeout))}v.hDiv.scrollLeft=this.scrollLeft;a.footerrow&&(v.sDiv.scrollLeft=this.scrollLeft);
return!1},selectionPreserver:function(){var b=c(this),e=a.selrow,d=a.selarrrow?c.makeArray(a.selarrrow):null,f=this.grid.bDiv,g=f.scrollLeft,l=function(){var c;a.selrow=null;if(!a.multiPageSelection){R(a.selarrrow);if(a.multiselect&&d&&0d.length)return!L&&h.title&&(L=m),G+" style\x3d'"+p(K)+"'"+(M?" class\x3d'"+p(M)+"'":"")+(L?" title\x3d'"+p(L)+"'":"");g=d[3];f=d[4];switch(d[1].toLowerCase()){case "class":M=M?M+(" "+g):g;break;case "title":L=g;break;case "style":K+=g;break;default:G+=" "+d[1]+"\x3d"+d[2]+g+d[2]}}h=(""!==K?"style\x3d'"+K+"'":"")+((void 0!==M?" class\x3d'"+M+"'":"")+(h.title&&m?" title\x3d'"+xa(d).replace(/'/g,"\x26apos;")+"'":
""));return h+G},Na=function(c){return null==c||""===c?"\x26#160;":a.autoencode?Pa(c):String(c)},Ca=function(c){var b=a.treeReader,e=b.loaded,d=b.leaf_field,f=b.expanded_field,g=function(a){return!0===a||"true"===a||"1"===a};if("nested"===a.treeGridModel&&!c[d]){var l=parseInt(c[b.left_field],10),b=parseInt(c[b.right_field],10);c[d]=b===l+1?!0:!1}void 0!==c[e]&&(c[e]=g(c[e]));c[d]=g(c[d]);c[f]=g(c[f])},Da=function(c,b){var e,d;for(e in a.indexByColumnData)a.indexByColumnData.hasOwnProperty(e)&&(d=
c[e],c.hasOwnProperty(e)&&void 0!==d&&""!==d&&(a.ignoreCase&&(d=String(d).toLowerCase()),void 0===a.indexByColumnData[e][d]&&(a.indexByColumnData[e][d]={}),a.indexByColumnData[e][d][b]=c[e],void 0===a.dataIndexById[b]&&(a.dataIndexById[b]={}),void 0===a.dataIndexById[b][e]&&(a.dataIndexById[b][e]={}),a.dataIndexById[b][e][d]=a.indexByColumnData[e][d]))},Oa=function(){var c=a.data,b=c.length,d,f,g,k,h,n,q,r=a.localReader,u=a.additionalProperties,t=r.cell,x,v,w,C=a.arrayReaderInfos;if("local"!==a.datatype||
!0!==r.repeatitems){if(a.treeGrid)for(d=0;d=a.page&&(a.page=1);O=parseInt(a.rowNum,10);g&&(O*=g+1);var D=[],T=[],S,z=[];for(L=0;L=I.documentMode?K.html(K.html()+d.join("")):this.firstElementChild.innerHTML+=d.join(""),
this.grid.cols=this.rows[0].cells);if(a.grouping)for(ea.call(this),K=function(a){var b=c(this).closest("tr.jqgroup").attr("id");k.jqGrid("groupingToggle",b,this,a);return!1},L=0;L=b&&(b=c(this).closest(".ui-jqgrid\x3e.ui-jqgrid-view").css("font-size")||"11px",c(I.body).append("\x3cdiv id\x3d'testpg' class\x3d'"+
A("gBox","ui-jqgrid")+"' style\x3d'font-size:"+b+";visibility:hidden;margin:0;padding:0;' \x3e\x3c/div\x3e"),c(a).clone().appendTo("#testpg"),b=c("#testpg\x3e.ui-pg-table").width(),c("#testpg").remove());0=a.page&&(a.page=Math.min(1,a.lastpage));null!==n.search&&(m[n.search]=a.search);null!==n.nd&&(m[n.nd]=(new Date).getTime());if(isNaN(parseInt(a.rowNum,10))||0>=parseInt(a.rowNum,10))a.rowNum=a.maxRowNum;null!==n.rows&&(m[n.rows]=a.rowNum);null!==n.page&&(m[n.page]=a.page);null!==n.sort&&(m[n.sort]=a.sortname);null!==n.order&&(m[n.order]=a.sortorder);null!==a.rowTotal&&null!==n.totalrows&&(m[n.totalrows]=a.rowTotal);
var r=l(a.loadComplete),t=r?a.loadComplete:null,u=0;d=d||1;1=c&&(m=h=!1),G=n=!1):1f?b.push(d.index||d.name):""===d.lso&&0<=f&&b.splice(f,1)}t(a.colModel,function(){var a=this.index||this.name,d;this.lso&&(d=this.lso.split("-"),0>c.inArray(a,b)&&b.push(a),e[a]=d[d.length-1])})},bb=function(b,d){var f="",g=a.colModel[b],k,h=A("states.disabled");b=a.frozenColumns?c(e.grid.headers[b].el).add(c(d)):c(e.grid.headers[b].el);k=b.find("span.s-ico");d=k.children("span.ui-icon-asc");var m=k.children("span.ui-icon-desc"),G=d,p=m,H=[],r={};b.find("span.ui-grid-ico-sort").addClass(h);
b.attr("aria-selected","false");g.lso?(k.show(),k=g.lso.split("-"),k=k[k.length-1],"desc"===k&&(G=m,p=d),G.removeClass(h).css("display",""),a.showOneSortIcon&&p.hide(),b.attr("aria-selected","true")):a.viewsortcols[0]||k.hide();Ra(H,r,g);if("string"===typeof a.sortname&&""!==a.sortname&&a.sortname.split(",").lengtha.maxSortColumns;)h(H[H.length-1]);else l(a.multiSortOrder)&&(H=a.multiSortOrder.call(e,{sortNames:H,cm:g,sortDirs:r,removeSorting:h})||H);t(H,function(){0b?"\x26nbsp;":l(a.formatSortOrder)?a.formatSortOrder.call(e,{cm:this,sortIndex:b}):b+1)}})},Ta=function(e,d,f,g,k,l){var h=this.grid,m=a.colModel[d],n=A("states.disabled");if(null!=m&&m.sortable&&!(0n(g,a.reservedColumnNames)&&d.push(g);if(null!=c)for(b=d.slice(),f=0;fn(k,a.reservedColumnNames)&&!g.hasOwnProperty(k)&&(l=a.iColByName[k],void 0!==l?g[k]={name:k,index:l,order:h,type:0}:(l=a.iPropByName[k],void 0!==l?g[k]={name:k,index:l,order:h,type:1}:k===(a.prmNames.rowidName||"rowid")&&(g[k]={index:l,type:2})));f=e.length;for(b=0;bn(k,a.reservedColumnNames)&&!g.hasOwnProperty(k)&&(g[k]={name:k,index:b,order:h,type:0},h++);f=d.length;
for(b=0;bc.inArray(this.id,p)&&p.push(this.id),l&&k(l[a],d))});J.call(e,"onSelectAll",d?a.selarrrow:f,d)});!0===a.autowidth&&(x=Math.floor(c(h).innerWidth()),a.width=0d&&(this.hidden=!a.groupingView.groupColumnShow[d])}this.widthOrg=g=Q(this.width,0);!1!==this.hidden||p(this.classes)||(c+=g+b,this.fixed?h+=g+b:e++)});isNaN(a.width)&&
(a.width=c+(!1!==a.shrinkToFit||isNaN(a.height)?0:f));v.width=a.width;a.tblwidth=c;!1===a.shrinkToFit&&!0===a.forceFit&&(a.forceFit=!1);!0===a.shrinkToFit&&0a.width&&(a.colModel[d].width-=a.tblwidth-parseInt(a.width,10),a.tblwidth=a.width))})();c(h).css("width",v.width+"px").append("\x3cdiv class\x3d'"+A("resizer","ui-jqgrid-resize-mark")+"' id\x3d'"+a.rsId+"'\x3e\x26#160;\x3c/div\x3e");c(a.rs).on("selectstart",function(){return!1}).click(ha).dblclick(function(d){var f=c(this).data("idx"),g=c(this).data("pageX"),l=a.colModel[f];if(null==g||null==l)return!1;var g=String(g).split(";"),h=parseFloat(g[0]),m=parseFloat(g[1]);if(2===g.length&&
(5V?"\x26nbsp;":l(a.formatSortOrder)?a.formatSortOrder.call(e,{cm:this,sortIndex:V}):V+1)+"\x3c/span\x3e"))):(f="desc"===a.sortorder?"asc":"desc",a.viewsortcols[0]?
(h.css("display",""),b===a.lastsort&&(h.children("span.ui-icon-"+a.sortorder).removeClass(ia),m&&h.children("span.ui-icon-"+f).hide())):b===a.lastsort&&""!==d.lso&&(h.css("display",""),h.children("span.ui-icon-"+a.sortorder).removeClass(ia),m&&h.children("span.ui-icon-"+f).hide())));a.footerrow&&(Aa+="\x3ctd role\x3d'gridcell' "+la(b,0,"",null,"",!1)+"\x3e\x26#160;\x3c/td\x3e")}).mousedown(function(b){var e=c(this),d=e.closest(".ui-jqgrid-hdiv").hasClass("frozen-div"),f=function(){var b=[e.position().left+
e.outerWidth()];"rtl"===a.direction&&(b[0]=a.width-b[0]);b[0]-=d?0:v.bDiv.scrollLeft;b.push(c(v.hDiv).position().top);b.push(c(v.bDiv).offset().top-c(v.hDiv).offset().top+c(v.bDiv).height()+(v.sDiv?c(v.sDiv).height():0));return b},g;if(1===c(b.target).closest("th\x3espan.ui-jqgrid-resize").length)return g=a.iColByName[(this.id||"").substring(a.id.length+1)],null!=g&&(!0===a.forceFit&&(a.nv=cb(g)),v.dragStart(g,b,f(),e)),!1}).click(function(b){if(a.disableClick)return a.disableClick=!1;var d="th.ui-th-column\x3ediv",
f,g,d=a.viewsortcols[2]?d+".ui-jqgrid-sortable":d+"\x3espan.s-ico\x3espan.ui-grid-ico-sort",d=c(b.target).closest(d);if(1===d.length)return a.viewsortcols[2]||(f=!0,g=d.hasClass("ui-icon-desc")?"asc":"desc"),d=a.iColByName[(this.id||"").substring(a.id.length+1)],null!=d&&Ta.call(e,c("div",this)[0].id.substring(5+a.id.length+1),d,f,g,this,b),!1});if(a.sortable&&l(b.sortableColumns))try{b.sortableColumns.call(k,c(u[0].tHead.rows[0]))}catch(H){}a.footerrow&&(Aa+="\x3c/tr\x3e\x3c/tbody\x3e\x3c/table\x3e");
Ia+="\x3c/tr\x3e";k.html("\x3ctbody\x3e"+Ia+"\x3c/tbody\x3e");k.addClass(A("grid","ui-jqgrid-btable"+(!0===a.altRows&&k.jqGrid("isBootstrapGuiStyle")?" table-striped":"")));var W=a.caption&&!0===a.hiddengrid?!0:!1,y=c("\x3cdiv class\x3d'ui-jqgrid-hbox"+("rtl"===N?"-rtl":"")+"'\x3e\x3c/div\x3e"),x=A("top"),Ba=A("bottom");v.hDiv=I.createElement("div");c(v.hDiv).css({width:v.width+"px"}).addClass(A("hDiv","ui-jqgrid-hdiv")).append(y).scroll(function(){var a=c(this).next(".ui-jqgrid-bdiv")[0];a&&(a.scrollLeft=
this.scrollLeft);return!1});c(y).append(u);u=null;W&&c(v.hDiv).hide();a.rowNum=parseInt(a.rowNum,10);if(isNaN(a.rowNum)||0>=a.rowNum)a.rowNum=a.maxRowNum;a.pager&&("string"===typeof a.pager&&"#"!==a.pager.substr(0,1)?(u=a.pager,y=c("#"+F(a.pager))):!0===a.pager?(u=X(),y=c("\x3cdiv id\x3d'"+u+"'\x3e\x3c/div\x3e"),y.appendTo("body"),a.pager="#"+F(u)):(y=c(a.pager),u=y.attr("id")),0f.lastpage&&(g=f.lastpage);1>g&&(g=1);f.page=g;a.bDiv.scrollTop=a.prevRowHeight?(g-1)*a.prevRowHeight*f.rowNum:0}a.prevRowHeight&&f.scroll&&void 0===e.page?(delete f.lastpage,a.populateVisible.call(this)):a.populate.call(this);!0===f._inlinenav&&d.jqGrid("showAddEditButtons",!1);
return!1}).dblclick(function(a){var b=Ja.call(e,a.target),c=b.parent();if(0l&&(l=0);l*=parseInt(a.rowNum,10);n=l+a.reccount;if(a.scroll){r=c(ka(21,h)[0].rows).slice(1);l=n-r.length;a.reccount=r.length;if(r=r.outerHeight()||g.prevRowHeight)m=l*r,p=q.fixMaxHeightOfDiv.call(e,parseInt(a.records,10)*r),c(h).children("div").first().css({height:p+"px"}).children("div").first().css({height:m+
"px",display:m+"px"?"":"none"}),0===h.scrollTop&&1=h&&(g=0),0>=g&&(g=h=0),1===g||0===g?(c("#first"+u+", #prev"+u).addClass(z).removeClass(v),a.toppager&&c("#first_t"+w+", #prev_t"+w).addClass(z).removeClass(v)):(c("#first"+u+", #prev"+u).removeClass(z),
a.toppager&&c("#first_t"+w+", #prev_t"+w).removeClass(z)),g===h||0===g?(c("#next"+u+", #last"+u).addClass(z).removeClass(v),a.toppager&&c("#next_t"+w+", #last_t"+w).addClass(z).removeClass(v)):(c("#next"+u+", #last"+u).removeClass(z),a.toppager&&c("#next_t"+w+", #last_t"+w).removeClass(z)))}!0===b&&!0===a.rownumbers&&c("\x3etd.jqgrid-rownum",e.rows).each(function(a){c(this).html(l+1+a)});d&&a.jqgdnd&&f.jqGrid("gridDnD","updateDnD");J.call(e,"gridComplete");f.triggerHandler("jqGridAfterGridComplete")};
e.refreshIndex=Ea;e.addItemDataToColumnIndex=Da;e.removeItemDataFromColumnIndex=function(b){var d,e,f,g=a.dataIndexById[b];if(null!=g){for(d in g)if(g.hasOwnProperty(d))for(f in e=g[d],e)e.hasOwnProperty(f)&&(delete a.indexByColumnData[d][f][b],c.isEmptyObject(a.indexByColumnData[d][f])&&delete a.indexByColumnData[d][f]);delete a.dataIndexById[b]}};e.generateValueFromColumnIndex=function(a,b,d){a=c(this).jqGrid("getUniqueValueFromColumnIndex",a);var e="",f,g;if(null!=a)for(d=d||";",b=b||":",f=0,g=
a.length;fc?1:-1}):d.sort(function(b,c){return String(b).toLowerCase().localeCompare(String(c).toLowerCase())}):
d.sort()}return d},generateDatalistFromColumnIndex:function(d){if(!this[0]||!this[0].grid)return null;d=this.jqGrid("getUniqueValueFromColumnIndex",d);var b,e,f=c("\x3cdatalist\x3e\x3c/datalist\x3e");if(null!=d&&0=e+f?d.scrollTop=g-(e+f)+b+f:gc.inArray(r,h.reservedColumnNames)&&"actions"!==t.formatter&&(!b.skipHidden||!t.hidden))if(C=x[n],E.isCellEditing.call(c(this),d,n,k))e[r]=q.getEditedValue.call(this,q.getDataFieldOfCell.call(this,k,n),t,{},t.editable);else if(!0===h.treeGrid&&r===h.ExpandColumn)e[r]=ea(c("span",C).first().html());else try{e[r]=
c.unformat.call(this,C,{rowId:d,colModel:t},n)}catch(D){e[r]=ea(c(C).html())}!b.includeId||!1!==h.keyName&&null!=e[h.keyName]||(e[h.prmNames.id]=Z(h.idPrefix,k.id));g&&(f.push(e),e={})}});return f||e},delRowData:function(d){var b=!1;this.each(function(){var e=this.p,f=c.jgrid.detectRowEditing.call(this,d),h,g;h=E.getGridRowById.call(c(this),d);if(!h)return!1;e.subGrid&&(g=c(h).next(),g.hasClass("ui-subgrid")&&g.remove());if(null!=f)try{"inlineEditing"===f.mode&&null!=E.restoreRow?E.restoreRow.call(c(this),
d):"cellEditing"===f.mode&&null!=E.restoreCell&&E.restoreCell.call(c(this),f.savedRow.id,f.savedRow.ic)}catch(m){}h.rowIndex===e.iRow&&(e.iRow=-1,e.iCol=-1);c(h).remove();e.records--;e.reccount--;this.updatepager(!0,!1);b=!0;e.multiselect&&(f=c.inArray(d,e.selarrrow),-1!==f&&e.selarrrow.splice(f,1));e.multiselect&&0c.inArray(e,"first last before after afterSelected beforeSelected".split(" "))&&(e="last");var h=!1,g,k,l,m,p,n,x,t,r,C,D;b&&(c.isArray(b)?(n=!0,x=d):(b=[b],n=!1),this.each(function(){var z=this.p,y=b.length,u=c(this),w=this.rows,B=0,A=E.getGridRowById,a=z.colModel,F,I=z.additionalProperties,O;n||(void 0!==d?d=String(d):(d=X(),!1!==z.keyName&&(x=z.keyName,void 0!==b[0][x]&&(d=b[0][x]))));for(t=z.altclass;Bc.inArray(m,g.reservedColumnNames)&&(!1!==b?(k=c(n[p]).text(),c.trim(k)&&(h[m]=k)):h[m]=c(n[p]).html());else if("set"===d)for(m in b)p=g.iColByName[m],b.hasOwnProperty(m)&&void 0!==p&&(k=e?this.formatter("",b[m],p,b,"edit"):b[m],l=c(n[p]).add(t[p]),l.html(k),q[p].title&&l.attr({title:xa(k)}))});
return"get"===d?h:f},resetColumnResizerHeight:function(){return this.each(function(){if(c.jgrid.msie){var d,b,e,f=this.grid.headers,h;for(e=0;en.length&&(p.detach(),q.detach(),m.wrapInner("\x3cspan class\x3d'"+f.autoResizing.wrapperClassName+
"'\x3e\x3c/span\x3e"),n=m.children("span."+f.autoResizing.wrapperClassName),y()),l=p.outerWidth(!0),t=n.outerWidth(),C=parseFloat(k.css("padding-top")||0),D=parseFloat(k.css("padding-bottom")||0),n=parseFloat(k.css("padding-left")||0),r=parseFloat(k.css("padding-right")||0),f.showSortOrder&&(l+=.5*l),l=void 0===b||0===b?t+l+n+r:b,k.height(l),k.css({paddingTop:r+"px",paddingBottom:n+"px",paddingLeft:C+"px",paddingRight:D+"px"}),m.css("min-width",l-n-r+"px").addClass("ui-jqgrid-rotate").css({bottom:0}),
f.colModel[g].rotated=!0);e.jqGrid("resetColumnResizerHeight");f.frozenColumns&&setTimeout(function(){e.triggerHandler("jqGridResetFrozenHeights",{header:{resizeDiv:!0,resizedRows:{iRowStart:0,iRowEnd:-1}},resizeFooter:!0,body:{resizeDiv:!0,resizedRows:{iRowStart:-1,iRowEnd:-1}}})},0)})},showHideCol:function(d,b,e){return this.each(function(){var f=this,h=c(f),g=f.grid,k=!1,l=f.p,m=q.cell_width?0:l.cellLayout,p;if(g){"string"===typeof d&&(d=[d]);b="none"!==b&&!1!==b?"":"none";e=e||{};var n=""===b?
!0:!1,x=l.groupHeader;(x=x&&("object"===typeof x||c.isFunction(x)))&&!e.skipSetGroupHeaders&&E.destroyGroupHeader.call(h,!1);c(l.colModel).each(function(h){var q=function(d){var e,f,g,k,m,p,a,q,r,t;e=0;for(f=d.length;eg("subgrid",d)&&d.unshift("subgrid");f.multiselect&&0>g("cb",d)&&d.unshift("cb");f.rownumbers&&0>g("rn",d)&&d.unshift("rn");g=0;for(k=d.length;gE)return;g=0;a=0t&&(p=e.tblwidth-parseInt(t,10),e.tblwidth=t,r.width-=p);f=r.width;t=z[k];t.width=f;F[k].style.width=f+"px";a&&(A[k].style.width=f+"px");e.footerrow&&(y[k].style.width=f+"px");e.tblwidth+(m?C:0)u.clientWidth&&(e.autowidth||void 0!==e.widthOrg&&"auto"!==e.widthOrg&&"100%"!==e.widthOrg||I(u.offsetWidth))}e.tblwidth&&(e.tblwidth=parseInt(e.tblwidth,10),t=e.tblwidth,w.scrollLeft=u.scrollLeft,
p=Math.abs(t-e.width),e.shrinkToFit&&!b&&3>p&&0u.clientWidth&&(e.autowidth||void 0!==e.widthOrg&&"auto"!==e.widthOrg&&"100%"!==e.widthOrg||I(u.offsetWidth))));this.fixScrollOffsetAndhBoxPadding();m={resizeDiv:!0,resizedRows:{iRowStart:b?0:-1,iRowEnd:-1}};c(this).triggerHandler("jqGridResetFrozenHeights",[{header:m,resizeFooter:!0,body:m}])}}})},setGridHeight:function(d){return this.each(function(){var b=this.grid,e=this.p;if(b){var f=c(b.bDiv);f.css({height:d+(isNaN(d)?
"":"px")});!0===e.frozenColumns&&c(e.idSel+"_frozen").parent().height(f.height()-16);e.height=d;e.scroll&&b.populateVisible.call(this);this.fixScrollOffsetAndhBoxPadding();c(this).triggerHandler("jqGridResetFrozenHeights")}})},setCaption:function(d){return this.each(function(){var b=this.grid.cDiv;this.p.caption=d;c("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",b).html(d);c(b).show();c(b).nextAll("div").removeClass(E.getGuiStyles.call(this,"top"));c(this).triggerHandler("jqGridResetFrozenHeights")})},
setLabel:function(d,b,e,f){return this.each(function(){var h,g=this.p,k;if(this.grid){if(isNaN(d)){if(h=g.iColByName[d],void 0===h)return}else h=parseInt(d,10);0<=h&&(k=c(this.grid.headers[h].el),g.frozenColumns&&(k=k.add(this.grid.fhDiv.find("#"+F(k)))),b&&(k.each(function(){var d=c("[id^\x3djqgh_]",this),e=d.children("span.ui-jqgrid-cell-wrapper");0g||g===h.width)){E.setColWidth.call(e,d,g,f.autoResizing.adjustGridWidth&&!f.autoResizing.fixWidthOnShrink&&!b,b);f.autoResizing.fixWidthOnShrink&&f.shrinkToFit&&!b&&(h.fixed=!0,g=h.widthOrg,h.widthOrg=h.width,E.setGridWidth.call(e,f.width,!0),h.widthOrg=g,h.fixed=!1);if(l||void 0===l&&f.autoResizing.resetWidthOrg)h.widthOrg=h.width;k.data("autoResized","true")}})},autoResizeAllColumns:function(){return this.each(function(){var d=c(this),b=this.p,e=b.colModel,f=e.length,h,g,k=b.shrinkToFit,
l=b.autoResizing.adjustGridWidth,m=b.autoResizing.fixWidthOnShrink,p=parseInt(b.widthOrg,10),n=this.grid,q=E.autoResizeColumn;b.shrinkToFit=!1;b.autoResizing.adjustGridWidth=!0;b.autoResizing.fixWidthOnShrink=!1;for(h=0;h