All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.js.plugins.jquery.jqGrid.min.js Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
/*
 jqGrid  4.7.0 - jQuery Grid
 Copyright (c) 2008, Tony Tomov, [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: 2014-12-08
*/
'use strict';(function(a){a.widget("ui.multiselect",{_init:function(){this.element.hide();this.id=this.element.attr("id");this.container=a('\x3cdiv class\x3d"ui-multiselect ui-helper-clearfix ui-widget"\x3e\x3c/div\x3e').insertAfter(this.element);this.count=0;this.selectedContainer=a('\x3cdiv class\x3d"selected"\x3e\x3c/div\x3e').appendTo(this.container);this.availableContainer=a('\x3cdiv class\x3d"available"\x3e\x3c/div\x3e').appendTo(this.container);this.selectedActions=a('\x3cdiv class\x3d"actions ui-widget-header ui-helper-clearfix"\x3e\x3cspan class\x3d"count"\x3e0 '+
a.ui.multiselect.locale.itemsCount+'\x3c/span\x3e\x3ca href\x3d"#" class\x3d"remove-all"\x3e'+a.ui.multiselect.locale.removeAll+"\x3c/a\x3e\x3c/div\x3e").appendTo(this.selectedContainer);this.availableActions=a('\x3cdiv class\x3d"actions ui-widget-header ui-helper-clearfix"\x3e\x3cinput type\x3d"text" class\x3d"search empty ui-widget-content ui-corner-all"/\x3e\x3ca href\x3d"#" class\x3d"add-all"\x3e'+a.ui.multiselect.locale.addAll+"\x3c/a\x3e\x3c/div\x3e").appendTo(this.availableContainer);this.selectedList=
a('\x3cul class\x3d"selected connected-list"\x3e\x3cli class\x3d"ui-helper-hidden-accessible"\x3e\x3c/li\x3e\x3c/ul\x3e').bind("selectstart",function(){return!1}).appendTo(this.selectedContainer);this.availableList=a('\x3cul class\x3d"available connected-list"\x3e\x3cli class\x3d"ui-helper-hidden-accessible"\x3e\x3c/li\x3e\x3c/ul\x3e').bind("selectstart",function(){return!1}).appendTo(this.availableContainer);var d=this;this.container.width(this.element.width()+1);this.selectedContainer.width(Math.floor(this.element.width()*
this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));this.options.animated||(this.options.show="show",this.options.hide="hide");this._populateLists(this.element.find("option"));this.options.sortable&&a("ul.selected").sortable({placeholder:"ui-state-highlight",
axis:"y",update:function(c,e){d.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(d.element)})},receive:function(c,e){e.item.data("optionLink").attr("selected",!0);d.count+=1;d._updateCount();d.selectedList.children(".ui-draggable").each(function(){a(this).removeClass("ui-draggable");a(this).data("optionLink",e.item.data("optionLink"));a(this).data("idx",e.item.data("idx"));d._applyItemState(a(this),!0)});setTimeout(function(){e.item.remove()},
1)}});this.options.searchable?this._registerSearchEvents(this.availableContainer.find("input.search")):a(".search").hide();a(".remove-all").click(function(){d._populateLists(d.element.find("option").removeAttr("selected"));return!1});a(".add-all").click(function(){d._populateLists(d.element.find("option").attr("selected","selected"));return!1})},destroy:function(){this.element.show();this.container.remove();a.widget.prototype.destroy.apply(this,arguments)},_populateLists:function(d){this.selectedList.children(".ui-element").remove();
this.availableList.children(".ui-element").remove();this.count=0;var c=this;a(d.map(function(a){var d=c._getOptionNode(this).appendTo(this.selected?c.selectedList:c.availableList).show();this.selected&&(c.count+=1);c._applyItemState(d,this.selected);d.data("idx",a);return d[0]}));this._updateCount()},_updateCount:function(){this.selectedContainer.find("span.count").text(this.count+" "+a.ui.multiselect.locale.itemsCount)},_getOptionNode:function(d){d=a(d);var c=a('\x3cli class\x3d"ui-state-default ui-element" title\x3d"'+
d.text()+'"\x3e\x3cspan class\x3d"ui-icon"/\x3e'+d.text()+'\x3ca href\x3d"#" class\x3d"action"\x3e\x3cspan class\x3d"ui-corner-all ui-icon"/\x3e\x3c/a\x3e\x3c/li\x3e').hide();c.data("optionLink",d);return c},_cloneWithData:function(a){var c=a.clone();c.data("optionLink",a.data("optionLink"));c.data("idx",a.data("idx"));return c},_setSelected:function(d,c){d.data("optionLink").attr("selected",c);if(c){var e=this._cloneWithData(d);d[this.options.hide](this.options.animated,function(){a(this).remove()});
e.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(e,!0);return e}var f=this.availableList.find("li"),h=this.options.nodeComparator,e=null,b=d.data("idx"),g=h(d,a(f[b]));if(g)for(;0<=b&&b/g,"\x26gt;"):a},format:function(d){var c=a.makeArray(arguments).slice(1);null==d&&(d="");
return d.replace(/\{(\d+)\}/g,function(a,d){return c[d]})},msie:"Microsoft Internet Explorer"===navigator.appName,msiever:function(){var a=-1;null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return a},getCellIndex:function(d){d=a(d);if(d.is("tr"))return-1;d=(d.is("td")||d.is("th")?d:d.closest("td,th"))[0];return a.jgrid.msie?a.inArray(d,d.parentNode.cells):d.cellIndex},stripHtml:function(a){a=String(a);var c=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return a?(a=a.replace(c,
""))&&"\x26nbsp;"!==a&&"\x26#160;"!==a?a.replace(/\"/g,"'"):"":a},stripPref:function(d,c){var e=a.type(d);if("string"===e||"number"===e)d=String(d),c=""!==d?String(c).replace(String(d),""):c;return c},parse:function(d){"while(1);"===d.substr(0,9)&&(d=d.substr(9));"/*"===d.substr(0,2)&&(d=d.substr(2,d.length-4));d||(d="{}");return!0===a.jgrid.useJSON&&"object"===typeof JSON&&"function"===typeof JSON.parse?JSON.parse(d):eval("("+d+")")},parseDate:function(d,c,e,f){var h=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,
b="string"===typeof c?c.match(h):null,h=function(a,b){a=String(a);for(b=parseInt(b,10)||2;a.lengthb&&(c[l]=b+1,g.m=c[l])),"F"===d[l]&&(b=a.inArray(c[l],f.monthNames,12),-1!==b&&11b&&c[l]===f.AmPm[b]&&(c[l]=b,g.h=k(c[l],g.h))),"A"===d[l]&&(b=a.inArray(c[l],f.AmPm),-1!==b&&1=k?g.y=1900+g.y:0<=k&&69>=k&&(g.y=2E3+g.y);k=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u);0p?Math.floor((s+p-1)/7)+1:Math.floor((s+p-1)/7)||(4>((new Date(q-1,0,1)).getDay()+6)%7?53:52),F:f.monthNames[n-1+12],m:h(n),M:f.monthNames[n-1],n:n,t:"?",L:"?",o:"?",Y:q,y:String(q).substring(2),a:12>d?f.AmPm[0]:f.AmPm[1],A:12>d?f.AmPm[2]:f.AmPm[3],B:"?",g:d%12||12,G:d,h:h(d%12||12),H:h(d),i:h(c),s:h(l),u:m,e:"?",I:"?",O:(0?@\[\\\]\^`{|}~]/g,"\\$\x26")},guid:1,uidPref:"jqg",randId:function(d){return(d||a.jgrid.uidPref)+a.jgrid.guid++},getAccessor:function(a,c){var e,f,h=[],b;if("function"===typeof c)return c(a);e=a[c];if(void 0===e)try{if("string"===typeof c&&
(h=c.split(".")),b=h.length)for(e=a;e&&b--;)f=h.shift(),e=e[f]}catch(g){}return e},getXmlData:function(d,c,e){var f="string"===typeof c?c.match(/^(.*)\[(\w+)\]$/):null;if("function"===typeof c)return c(d);if(f&&f[2])return f[1]?a(f[1],d).attr(f[2]):a(d).attr(f[2]);d=a(c,d);return e?d:0c?d:0;b||"number"===typeof a||"number"===typeof c||(a=String(a),c=String(c));return ac?d:0};this._performSort=function(){0!==s.length&&(h=f._doSort(h,0))};this._doSort=function(a,b){var c=s[b].by,d=s[b].dir,e=s[b].type,g=s[b].datefmt,h=s[b].sfunc;if(b===s.length-1)return f._getOrder(a,c,d,e,g,h);b++;c=f._getGroup(a,c,d,e,g);d=[];for(e=0;ee.minColWidth&&(a.newWidth=c,d.newWidth=b)):(this.newWidth="ltr"===e.direction?e.tblwidth+b:e.tblwidth-b,a.newWidth=c))}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var c=this.resizing.idx,d=this.headers[c].newWidth||this.headers[c].width,d=parseInt(d,10);this.resizing=!1;a("#rs_m"+a.jgrid.jqID(e.id)).css("display",
"none");e.colModel[c].width=d;this.headers[c].width=d;this.headers[c].el.style.width=d+"px";this.cols[c].style.width=d+"px";0=m&&(void 0===e.lastpage||(parseInt((n+d+f-1)/f,10)||0)<=e.lastpage)&&(r=parseInt((b-n+f-1)/f,10)||1,0<=n||2>r||!0===e.scroll?(p=(Math.round((n+d)/f)||0)+1,m=-1):m=1);0e.lastpage||1===e.lastpage||p===e.page&&p===e.lastpage)||(g.hDiv.loading?g.timer=setTimeout(g.populateVisible,e.scrollTimeout):(e.page=p,q&&(g.selectionPreserver(c[0]),g.emptyRows.call(c[0],!1,!1)),g.populate(r)))}}},scrollGrid:function(a){if(e.scroll){var b=g.bDiv.scrollTop;void 0===g.scrollTop&&(g.scrollTop=0);b!==g.scrollTop&&(g.scrollTop=b,g.timer&&clearTimeout(g.timer),g.timer=setTimeout(g.populateVisible,e.scrollTimeout))}g.hDiv.scrollLeft=
g.bDiv.scrollLeft;e.footerrow&&(g.sDiv.scrollLeft=g.bDiv.scrollLeft);a&&a.stopPropagation()},selectionPreserver:function(b){var c=b.p,d=c.selrow,e=c.selarrrow?a.makeArray(c.selarrrow):null,f=b.grid.bDiv.scrollLeft,g=function(){var k;c.selrow=null;c.selarrrow=[];if(c.multiselect&&e&&0=document.documentMode)alert("Grid can not be used in this ('quirks') mode!");else{a(this).empty().attr("tabindex","0");this.p=e;this.p.useProp=!!a.fn.prop;var k,l;if(0===this.p.colNames.length)for(k=0;k=b.p.page&&(b.p.page=1);if(c&&I){g&&(Y*=g+1);g=a.isFunction(b.p.afterInsertRow);var P=!1,F;b.p.grouping&&(P=!0===b.p.groupingView.groupCollapse,F=a.jgrid.getMethod("groupingPrepare"));for(;E=b.p.page&&(b.p.page=1);var aa=parseInt(b.p.rowNum,10),P=b.p.scroll?a.jgrid.randId():1,L=!1,K;g&&(aa*=g+1);"local"!==b.p.datatype||
b.p.deselectAfterSort||(L=!0);var ga=a.isFunction(b.p.afterInsertRow);g=[];var Q=!1,S;b.p.grouping&&(Q=!0===b.p.groupingView.groupCollapse,S=a.jgrid.getMethod("groupingPrepare"));for(;q=b.p.page&&(b.p.page=Math.min(1,b.p.lastpage));null!==g.search&&(e[g.search]=b.p.search);null!==g.nd&&(e[g.nd]=(new Date).getTime());null!==g.rows&&(e[g.rows]=b.p.rowNum);null!==g.page&&(e[g.page]=b.p.page);null!==g.sort&&(e[g.sort]=b.p.sortname);null!==g.order&&(e[g.order]=b.p.sortorder);null!==b.p.rowTotal&&null!==g.totalrows&&(e[g.totalrows]=
b.p.rowTotal);var k=a.isFunction(b.p.loadComplete),h=k?b.p.loadComplete:null,l=0;c=c||1;1
f&&(this.hidden=!b.p.groupingView.groupColumnShow[f])}this.widthOrg=h=r(this.width,0);!1===this.hidden&&(c+=h+d,this.fixed?n+=h+d:e++)});isNaN(b.p.width)&&(b.p.width=c+(!1!==b.p.shrinkToFit||isNaN(b.p.height)?0:k));g.width=b.p.width;b.p.tblwidth=c;!1===b.p.shrinkToFit&&!0===b.p.forceFit&&(b.p.forceFit=!1);!0===b.p.shrinkToFit&&0b.p.width&&(b.p.colModel[f].width-=b.p.tblwidth-parseInt(b.p.width,10),b.p.tblwidth=b.p.width))})();a(n).css("width",g.width+"px").append("\x3cdiv class\x3d'ui-jqgrid-resize-mark' id\x3d'rs_m"+b.p.id+"'\x3e\x26#160;\x3c/div\x3e");a(m).css("width",g.width+"px");x=a("thead:first",b).get(0);var da="";b.p.footerrow&&
(da+="\x3ctable role\x3d'presentation' style\x3d'width:"+b.p.tblwidth+"px' class\x3d'ui-jqgrid-ftable' cellspacing\x3d'0' cellpadding\x3d'0' border\x3d'0'\x3e\x3ctbody\x3e\x3ctr role\x3d'row' class\x3d'ui-widget-content footrow footrow-"+l+"'\x3e");var m=a("tr:first",x),ha="\x3ctr class\x3d'jqgfirstrow' role\x3d'row' style\x3d'height:auto'\x3e";b.p.disableClick=!1;a("th",m).each(function(c){la=b.p.colModel[c].width;void 0===b.p.colModel[c].resizable&&(b.p.colModel[c].resizable=!0);b.p.colModel[c].resizable?
(ia=document.createElement("span"),a(ia).html("\x26#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+l).css("cursor","col-resize"),a(this).addClass(b.p.resizeclass)):ia="";a(this).css("width",la+"px").prepend(ia);ia=null;var d="";b.p.colModel[c].hidden&&(a(this).css("display","none"),d="display:none;");ha+="\x3ctd role\x3d'gridcell' style\x3d'height:0px;width:"+la+"px;"+d+"'\x3e\x3c/td\x3e";g.headers[c]={width:la,el:this};ma=b.p.colModel[c].sortable;"boolean"!==typeof ma&&(ma=b.p.colModel[c].sortable=
!0);d=b.p.colModel[c].name;"cb"!==d&&"subgrid"!==d&&"rn"!==d&&b.p.viewsortcols[2]&&a("\x3ediv",this).addClass("ui-jqgrid-sortable");ma&&(b.p.multiSort?b.p.viewsortcols[0]?(a("div span.s-ico",this).show(),b.p.colModel[c].lso&&a("div span.ui-icon-"+b.p.colModel[c].lso,this).removeClass("ui-state-disabled")):b.p.colModel[c].lso&&(a("div span.s-ico",this).show(),a("div span.ui-icon-"+b.p.colModel[c].lso,this).removeClass("ui-state-disabled")):b.p.viewsortcols[0]?(a("div span.s-ico",this).show(),c===b.p.lastsort&&
a("div span.ui-icon-"+b.p.sortorder,this).removeClass("ui-state-disabled")):c===b.p.lastsort&&""!==b.p.sortname&&(a("div span.s-ico",this).show(),a("div span.ui-icon-"+b.p.sortorder,this).removeClass("ui-state-disabled")));b.p.footerrow&&(da+="\x3ctd role\x3d'gridcell' "+q(c,0,"",null,"",!1)+"\x3e\x26#160;\x3c/td\x3e")}).mousedown(function(c){if(1===a(c.target).closest("th\x3espan.ui-jqgrid-resize").length){var d=I(this);if(!0===b.p.forceFit){var e=b.p,f=d,k;for(k=d+1;kb.p.lastpage&&(e=b.p.lastpage);1>e&&(e=1);b.p.page=e;b.grid.bDiv.scrollTop=b.grid.prevRowHeight?(e-1)*b.grid.prevRowHeight*b.p.rowNum:0}b.grid.prevRowHeight&&
b.p.scroll?(delete b.p.lastpage,b.grid.populateVisible()):b.grid.populate();!0===b.p._inlinenav&&a(b).jqGrid("showAddEditButtons");return!1}).dblclick(function(c){A=c.target;D=a(A,b.rows).closest("tr.jqgrow");if(0!==a(D).length){K=D[0].rowIndex;ba=a.jgrid.getCellIndex(A);var d=a(b).triggerHandler("jqGridDblClickRow",[a(D).attr("id"),K,ba,c]);if(null!=d||a.isFunction(b.p.ondblClickRow)&&(d=b.p.ondblClickRow.call(b,a(D).attr("id"),K,ba,c),null!=d))return d}}).bind("contextmenu",function(c){A=c.target;
D=a(A,b.rows).closest("tr.jqgrow");if(0!==a(D).length){b.p.multiselect||a(b).jqGrid("setSelection",D[0].id,!0,c);K=D[0].rowIndex;ba=a.jgrid.getCellIndex(A);var d=a(b).triggerHandler("jqGridRightClickRow",[a(D).attr("id"),K,ba,c]);if(null!=d||a.isFunction(b.p.onRightClickRow)&&(d=b.p.onRightClickRow.call(b,a(D).attr("id"),K,ba,c),null!=d))return d}});g.bDiv=document.createElement("div");c&&"auto"===String(b.p.height).toLowerCase()&&(b.p.height="100%");a(g.bDiv).append(a('\x3cdiv style\x3d"position:relative;'+
(c&&8>a.jgrid.msiever()?"height:0.01%;":"")+'"\x3e\x3c/div\x3e').append("\x3cdiv\x3e\x3c/div\x3e").append(this)).addClass("ui-jqgrid-bdiv").css({height:b.p.height+(isNaN(b.p.height)?"":"px"),width:g.width+"px"}).scroll(g.scrollGrid);a("table:first",g.bDiv).css({width:b.p.tblwidth+"px"});a.support.tbody||2===a("tbody",this).length&&a("tbody:gt(0)",this).remove();b.p.multikey&&(a.jgrid.msie?a(g.bDiv).bind("selectstart",function(){return!1}):a(g.bDiv).bind("mousedown",function(){return!1}));Z&&a(g.bDiv).hide();
g.cDiv=document.createElement("div");var pa=!0===b.p.hidegrid?a("\x3ca role\x3d'link' class\x3d'ui-jqgrid-titlebar-close ui-corner-all HeaderButton' "+(b.p.showhide?"title\x3d'"+b.p.showhide+"'":"")+" /\x3e").hover(function(){pa.addClass("ui-state-hover")},function(){pa.removeClass("ui-state-hover")}).append("\x3cspan class\x3d'ui-icon ui-icon-circle-triangle-n'\x3e\x3c/span\x3e").css("rtl"===l?"left":"right","0px"):"";a(g.cDiv).append(pa).append("\x3cspan class\x3d'ui-jqgrid-title'\x3e"+b.p.caption+
"\x3c/span\x3e").addClass("ui-jqgrid-titlebar ui-jqgrid-caption"+("rtl"===l?"-rtl":"")+" ui-widget-header ui-corner-top ui-helper-clearfix");a(g.cDiv).insertBefore(g.hDiv);b.p.toolbar[0]&&(g.uDiv=document.createElement("div"),"top"===b.p.toolbar[1]?a(g.uDiv).insertBefore(g.hDiv):"bottom"===b.p.toolbar[1]&&a(g.uDiv).insertAfter(g.hDiv),"both"===b.p.toolbar[1]?(g.ubDiv=document.createElement("div"),a(g.uDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id).insertBefore(g.hDiv),a(g.ubDiv).addClass("ui-userdata ui-state-default").attr("id",
"tb_"+this.id).insertAfter(g.hDiv),Z&&a(g.ubDiv).hide()):a(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id),Z&&a(g.uDiv).hide());b.p.toppager&&(b.p.toppager=a.jgrid.jqID(b.p.id)+"_toppager",g.topDiv=a("\x3cdiv id\x3d'"+b.p.toppager+"'\x3e\x3c/div\x3e")[0],b.p.toppager="#"+b.p.toppager,a(g.topDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width).insertBefore(g.hDiv),ka(b.p.toppager,"_t"));b.p.footerrow&&(g.sDiv=a("\x3cdiv class\x3d'ui-jqgrid-sdiv'\x3e\x3c/div\x3e")[0],
k=a("\x3cdiv class\x3d'ui-jqgrid-hbox"+("rtl"===l?"-rtl":"")+"'\x3e\x3c/div\x3e"),a(g.sDiv).append(k).width(g.width).insertAfter(g.hDiv),a(k).append(da),g.footers=a(".ui-jqgrid-ftable",g.sDiv)[0].rows[0].cells,b.p.rownumbers&&(g.footers[0].className="ui-state-default jqgrid-rownum"),Z&&a(g.sDiv).hide());k=null;if(b.p.caption){var sa=b.p.datatype;!0===b.p.hidegrid&&(a(".ui-jqgrid-titlebar-close",g.cDiv).click(function(c){var d=a.isFunction(b.p.onHeaderClick),e=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",
f,k=this;!0===b.p.toolbar[0]&&("both"===b.p.toolbar[1]&&(e+=", #"+a(g.ubDiv).attr("id")),e+=", #"+a(g.uDiv).attr("id"));f=a(e,"#gview_"+a.jgrid.jqID(b.p.id)).length;"visible"===b.p.gridstate?a(e,"#gbox_"+a.jgrid.jqID(b.p.id)).slideUp("fast",function(){f--;0===f&&(a("span",k).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s"),b.p.gridstate="hidden",a("#gbox_"+a.jgrid.jqID(b.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(b.p.id)).hide(),a(b).triggerHandler("jqGridHeaderClick",
[b.p.gridstate,c]),d&&(Z||b.p.onHeaderClick.call(b,b.p.gridstate,c)))}):"hidden"===b.p.gridstate&&a(e,"#gbox_"+a.jgrid.jqID(b.p.id)).slideDown("fast",function(){f--;0===f&&(a("span",k).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n"),Z&&(b.p.datatype=sa,U(),Z=!1),b.p.gridstate="visible",a("#gbox_"+a.jgrid.jqID(b.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(b.p.id)).show(),a(b).triggerHandler("jqGridHeaderClick",[b.p.gridstate,c]),d&&
(Z||b.p.onHeaderClick.call(b,b.p.gridstate,c)))});return!1}),Z&&(b.p.datatype="local",a(".ui-jqgrid-titlebar-close",g.cDiv).trigger("click")))}else a(g.cDiv).hide(),a(g.hDiv).addClass("ui-corner-top");a(g.hDiv).after(g.bDiv).mousemove(function(a){if(g.resizing)return g.dragMove(a),!1});a(".ui-jqgrid-labels",g.hDiv).bind("selectstart",function(){return!1});a(document).bind("mouseup.jqGrid"+b.p.id,function(){return g.resizing?(g.dragEnd(),!1):!0});b.formatCol=q;b.sortData=Y;b.updatepager=function(c,
d){var e,f,g,k,h,l,m,n="",p=b.p.pager?"_"+a.jgrid.jqID(b.p.pager.substr(1)):"",q=b.p.toppager?"_"+b.p.toppager.substr(1):"";g=parseInt(b.p.page,10)-1;0>g&&(g=0);g*=parseInt(b.p.rowNum,10);h=g+b.p.reccount;if(b.p.scroll){e=a("tbody:first \x3e tr:gt(0)",b.grid.bDiv);g=h-e.length;b.p.reccount=e.length;if(e=e.outerHeight()||b.grid.prevRowHeight)f=g*e,m=parseInt(b.p.records,10)*e,a("\x3ediv:first",b.grid.bDiv).css({height:m}).children("div:first").css({height:f,display:f?"":"none"}),0==b.grid.bDiv.scrollTop&&
1=e&&(e=f=0),1===e||0===e?(a("#first"+p+", #prev"+p).addClass("ui-state-disabled").removeClass("ui-state-hover"),b.p.toppager&&a("#first_t"+q+", #prev_t"+q).addClass("ui-state-disabled").removeClass("ui-state-hover")):
(a("#first"+p+", #prev"+p).removeClass("ui-state-disabled"),b.p.toppager&&a("#first_t"+q+", #prev_t"+q).removeClass("ui-state-disabled")),e===f||0===e?(a("#next"+p+", #last"+p).addClass("ui-state-disabled").removeClass("ui-state-hover"),b.p.toppager&&a("#next_t"+q+", #last_t"+q).addClass("ui-state-disabled").removeClass("ui-state-hover")):(a("#next"+p+", #last"+p).removeClass("ui-state-disabled"),b.p.toppager&&a("#next_t"+q+", #last_t"+q).removeClass("ui-state-disabled")));!0===c&&!0===b.p.rownumbers&&
a("\x3etd.jqgrid-rownum",b.rows).each(function(b){a(this).html(g+1+b)});d&&b.p.jqgdnd&&a(b).jqGrid("gridDnD","updateDnD");a(b).triggerHandler("jqGridGridComplete");a.isFunction(b.p.gridComplete)&&b.p.gridComplete.call(b);a(b).triggerHandler("jqGridAfterGridComplete")};b.refreshIndex=Q;b.setHeadCheckBox=ca;b.constructTr=O;b.formatter=function(a,b,c,d,e){return s(a,b,c,d,e)};a.extend(g,{populate:U,emptyRows:N,beginReq:v,endReq:L});this.grid=g;b.addXmlData=function(a){X(a,b.grid.bDiv)};b.addJSONData=
function(a){F(a,b.grid.bDiv)};this.grid.cols=this.rows[0].cells;a(b).triggerHandler("jqGridInitGrid");a.isFunction(b.p.onInitGrid)&&b.p.onInitGrid.call(b);U();b.p.hiddengrid=!1}}}})};a.jgrid.extend({getGridParam:function(a){var c=this[0];if(c&&c.grid)return a?void 0!==c.p[a]?c.p[a]:null:c.p},setGridParam:function(d,c){return this.each(function(){null==c&&(c=!1);this.grid&&"object"===typeof d&&(!0===c?this.p=a.extend({},this.p,d):a.extend(!0,this.p,d))})},getGridRowById:function(d){var c;this.each(function(){try{for(var e=
this.rows.length;e--;)if(d.toString()===this.rows[e].id){c=this.rows[e];break}}catch(f){c=a(this.grid.bDiv).find("#"+a.jgrid.jqID(d))}});return c},getDataIDs:function(){var d=[],c=0,e,f=0;this.each(function(){if((e=this.rows.length)&&0=f+g?a(this.grid.bDiv)[0].scrollTop=k-(f+g)+b+g:kf||(this.width=f,h+=f,e.grid.headers[a].width=f,e.grid.headers[a].el.style.width=f+"px",e.p.footerrow&&(e.grid.footers[a].style.width=f+"px"),p&&(e.grid.cols[a].style.width=f+"px"),g=a))});if(!g)return;q=0;l?d-r-(h+b*k)!==m&&(q=d-r-(h+b*k)-m):1!==Math.abs(d-r-(h+b*k))&&(q=d-r-(h+b*k));e.p.colModel[g].width+=q;e.p.tblwidth=h+q+b*k+r;e.p.tblwidth>d?(l=e.p.tblwidth-parseInt(d,10),e.p.tblwidth=d,f=e.p.colModel[g].width-=l):f=e.p.colModel[g].width;e.grid.headers[g].width=f;e.grid.headers[g].el.style.width=
f+"px";p&&(e.grid.cols[g].style.width=f+"px");e.p.footerrow&&(e.grid.footers[g].style.width=f+"px")}e.p.tblwidth&&(a("table:first",e.grid.bDiv).css("width",e.p.tblwidth+"px"),a("table:first",e.grid.hDiv).css("width",e.p.tblwidth+"px"),e.grid.hDiv.scrollLeft=e.grid.bDiv.scrollLeft,e.p.footerrow&&a("table:first",e.grid.sDiv).css("width",e.p.tblwidth+"px"))}}})},setGridHeight:function(d){return this.each(function(){if(this.grid){var c=a(this.grid.bDiv);c.css({height:d+(isNaN(d)?"":"px")});!0===this.p.frozenColumns&&
a("#"+a.jgrid.jqID(this.p.id)+"_frozen").parent().height(c.height()-16);this.p.height=d;this.p.scroll&&this.grid.populateVisible()}})},setCaption:function(d){return this.each(function(){this.p.caption=d;a("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",this.grid.cDiv).html(d);a(this.grid.cDiv).show();a(this.grid.hDiv).removeClass("ui-corner-top")})},setLabel:function(d,c,e,f){return this.each(function(){var h=-1;if(this.grid&&void 0!==d&&(a(this.p.colModel).each(function(a){if(this.name===d)return h=
a,!1}),0<=h)){var b=a("tr.ui-jqgrid-labels th:eq("+h+")",this.grid.hDiv);if(c){var g=a(".s-ico",b);a("[id^\x3djqgh_]",b).empty().html(c).append(g);this.p.colNames[h]=c}e&&("string"===typeof e?a(b).addClass(e):a(b).css(e));"object"===typeof f&&a(b).attr(f)}})},setCell:function(d,c,e,f,h,b){return this.each(function(){var g=-1,k,l;if(this.grid&&(isNaN(c)?a(this.p.colModel).each(function(a){if(this.name===c)return g=a,!1}):g=parseInt(c,10),0<=g&&(k=a(this).jqGrid("getGridRowById",d)))){var m=a("td:eq("+
g+")",k);l=0;var n=[];if(""!==e||!0===b){for(;ld.search(/(false|f|0|no|n|off|undefined)/i)&&""!==d?(g.checked=!0,g.defaultChecked=!0,g.value=e):g.value="on",a(g).attr("offval","off"));b(g,c,["value"]);a(g).attr("role","checkbox");break;case "select":g=document.createElement("select");g.setAttribute("role","select");f=[];!0===c.multiple?(d=!0,g.multiple="multiple",a(g).attr("aria-multiselectable","true")):d=!1;if(void 0!==c.dataUrl){d=null;var l=c.postData||h.postData;try{d=c.rowId}catch(m){}k.p&&k.p.idPrefix&&(d=a.jgrid.stripPref(k.p.idPrefix,
d));a.ajax(a.extend({url:a.isFunction(c.dataUrl)?c.dataUrl.call(k,d,e,String(c.name)):c.dataUrl,type:"GET",dataType:"html",data:a.isFunction(l)?l.call(k,d,e,String(c.name)):l,context:{elem:g,options:c,vl:e},success:function(c){var d=[],e=this.elem,f=this.vl,g=a.extend({},this.options),h=!0===g.multiple;c=a.isFunction(g.buildSelect)?g.buildSelect.call(k,c):c;"string"===typeof c&&(c=a(a.trim(c)).html());c&&(a(e).append(c),b(e,g,l?["postData"]:void 0),void 0===g.size&&(g.size=h?3:1),h?(d=f.split(","),
d=a.map(d,function(b){return a.trim(b)})):d[0]=a.trim(f),setTimeout(function(){a("option",e).each(function(b){0===b&&e.multiple&&(this.selected=!1);a(this).attr("role","option");if(-1l.length||1>e[a[g]]||12l.length||1>e[a[f]]||31(0!==
h%4||0===h%100&&0!==h%400?28:29));return b||e[a[f]]>k[e[a[g]]]?!1:!0},isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(d){var c=/^(\d{1,2}):(\d{2})([apAP][Mm])?$/;if(!a.jgrid.isEmpty(d))if(d=d.match(c)){if(d[3]){if(1>d[1]||12parseFloat(h.maxValue))return[!1,b+": "+a.jgrid.edit.msg.maxValue+" "+h.maxValue,""];if(!(!0!==h.email||!1===e&&a.jgrid.isEmpty(d)||(f=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
f.test(d))))return[!1,b+": "+a.jgrid.edit.msg.email,""];if(!(!0!==h.integer||!1===e&&a.jgrid.isEmpty(d)||!isNaN(d)&&0===d%1&&-1===d.indexOf(".")))return[!1,b+": "+a.jgrid.edit.msg.integer,""];if(!(!0!==h.date||!1===e&&a.jgrid.isEmpty(d)||(g[c].formatoptions&&g[c].formatoptions.newformat?(g=g[c].formatoptions.newformat,a.jgrid.formatter.date.masks.hasOwnProperty(g)&&(g=a.jgrid.formatter.date.masks[g])):g=g[c].datefmt||"Y-m-d",a.jgrid.checkDate(g,d))))return[!1,b+": "+a.jgrid.edit.msg.date+" - "+g,
""];if(!0===h.time&&!(!1===e&&a.jgrid.isEmpty(d)||a.jgrid.checkTime(d)))return[!1,b+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(!(!0!==h.url||!1===e&&a.jgrid.isEmpty(d)||(f=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,f.test(d))))return[!1,b+": "+a.jgrid.edit.msg.url,""];if(!0===h.custom&&(!1!==e||!a.jgrid.isEmpty(d)))return a.isFunction(h.custom_func)?(d=h.custom_func.call(this,d,b,c),a.isArray(d)?d:[!1,a.jgrid.edit.msg.customarray,
""]):[!1,a.jgrid.edit.msg.customfcheck,""]}return[!0,"",""]}})})(jQuery);
(function(a){a.jgrid.extend({getColProp:function(a){var c={},e=this[0];if(!e.grid)return!1;var e=e.p.colModel,f;for(f=0;fb.length&&(c=b.length),e[c]=a,d=e.concat(f)):d=b});c.done&&c.done.call(f,d);f.jqGrid("setGridWidth",f[0].p.tblwidth,f[0].p.shrinkToFit)},cleanup:function(a){d(c.dlog,h,"destroy");d(c.msel,b,"destroy");h.remove();a&&c.done&&c.done.call(f)},msel_opts:{}},a.jgrid.col,c||{});if(a.ui&&a.ui.multiselect&&a.ui.multiselect.defaults){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
return}c.msel_opts=a.extend(a.ui.multiselect.defaults,c.msel_opts)}c.caption&&h.attr("title",c.caption);c.classname&&(h.addClass(c.classname),b.addClass(c.classname));c.width&&(a("\x3ediv",h).css({width:c.width,margin:"0 auto"}),b.css("width",c.width));c.height&&(a("\x3ediv",h).css("height",c.height),b.css("height",c.height-10));b.empty();a.each(n,function(c){g[this.name]=c;this.hidedlg?this.hidden||k.push(c):b.append("\x3coption value\x3d'"+c+"' "+(this.hidden?"":"selected\x3d'selected'")+"\x3e"+
a.jgrid.stripHtml(r[c])+"\x3c/option\x3e")});l=a.isFunction(c.dlog_opts)?c.dlog_opts.call(f,c):c.dlog_opts;d(c.dlog,h,l);l=a.isFunction(c.msel_opts)?c.msel_opts.call(f,c):c.msel_opts;d(c.msel,b,l);l=a("#colchooser_"+a.jgrid.jqID(f[0].p.id));l.css({margin:"auto"});l.find("\x3ediv").css({width:"100%",height:"100%",margin:"auto"});l=q(b);l.container.css({width:"100%",height:"100%",margin:"auto"});l.selectedContainer.css({width:100*l.options.dividerLocation+"%",height:"100%",margin:"auto",boxSizing:"border-box"});
l.availableContainer.css({width:100-100*l.options.dividerLocation+"%",height:"100%",margin:"auto",boxSizing:"border-box"});l.selectedList.css("height","auto");l.availableList.css("height","auto");m=Math.max(l.selectedList.height(),l.availableList.height());m=Math.min(m,a(window).height());l.selectedList.css("height",m);l.availableList.css("height",m)}},sortableRows:function(c){return this.each(function(){var d=this;d.grid&&!d.p.treeGrid&&a.fn.sortable&&(c=a.extend({cursor:"move",axis:"y",items:".jqgrow"},
c||{}),c.start&&a.isFunction(c.start)?(c._start_=c.start,delete c.start):c._start_=!1,c.update&&a.isFunction(c.update)?(c._update_=c.update,delete c.update):c._update_=!1,c.start=function(f,h){a(h.item).css("border-width","0");a("td",h.item).each(function(a){this.style.width=d.grid.cols[a].style.width});if(d.p.subGrid){var b=a(h.item).attr("id");try{a(d).jqGrid("collapseSubGridRow",b)}catch(g){}}c._start_&&c._start_.apply(this,[f,h])},c.update=function(f,h){a(h.item).css("border-width","");!0===d.p.rownumbers&&
a("td.jqgrid-rownum",d.rows).each(function(b){a(this).html(b+1+(parseInt(d.p.page,10)-1)*parseInt(d.p.rowNum,10))});c._update_&&c._update_.apply(this,[f,h])},a("tbody:first",d).sortable(c),a("tbody:first",d).disableSelection())})},gridDnD:function(c){return this.each(function(){function d(){var b=a.data(f,"dnd");a("tr.jqgrow:not(.ui-draggable)",f).draggable(a.isFunction(b.drag)?b.drag.call(a(f),b):b.drag)}var f=this,h,b;if(f.grid&&!f.p.treeGrid&&a.fn.draggable&&a.fn.droppable)if(void 0===a("#jqgrid_dnd")[0]&&
a("body").append("\x3ctable id\x3d'jqgrid_dnd' class\x3d'ui-jqgrid-dnd'\x3e\x3c/table\x3e"),"string"===typeof c&&"updateDnD"===c&&!0===f.p.jqgdnd)d();else if(c=a.extend({drag:function(b){return a.extend({start:function(c,d){var e;if(f.p.subGrid){e=a(d.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",e)}catch(h){}}for(e=0;e=this.length)break}d&&(u=b);return d}function q(c,d,e,f){var h=d.length,k,l,m,n,p="",q=[];a.isArray(e)?(n=e.length,q=e):(n=1,q[0]=e);b=[];g=[];for(m=b.root=0;m=m&&"_r_Totals"!==
s&&""===p&&(p=s)}b[l]=r;g[l]=q[m]}return f}function p(a){var b,c,d,f,g;for(d in a)if(a.hasOwnProperty(d)){if("object"!==typeof a[d]){if("level"===d){void 0===U[a.level]&&(U[a.level]="",0d,f=String(d),h=c.decimalSeparator||".",b;if(a.fmatter.isNumber(c.decimalPlaces)){var g=c.decimalPlaces,f=Math.pow(10,g),f=String(Math.round(d*f)/f);b=f.lastIndexOf(".");if(0b?(f+=h,b=f.length-1):"."!==h&&
(f=f.replace(".",h));f.length-1-bd.search(/(false|f|0|no|n|off|undefined)/i)?" checked\x3d'checked' ":"")+' value\x3d"'+d+'" offval\x3d"no" '+
f+"/\x3e"};a.fn.fmatter.link=function(d,c){var e={target:c.target},f="";void 0!==c.colModel&&void 0!==c.colModel.formatoptions&&(e=a.extend({},e,c.colModel.formatoptions));e.target&&(f="target\x3d"+e.target);return a.fmatter.isEmpty(d)?a.fn.fmatter.defaultFormat(d,c):"\x3ca "+f+' href\x3d"'+d+'"\x3e'+d+"\x3c/a\x3e"};a.fn.fmatter.showlink=function(d,c){var e={baseLinkUrl:c.baseLinkUrl,showAction:c.showAction,addParam:c.addParam||"",target:c.target,idName:c.idName},f="";void 0!==c.colModel&&void 0!==
c.colModel.formatoptions&&(e=a.extend({},e,c.colModel.formatoptions));e.target&&(f="target\x3d"+e.target);e=e.baseLinkUrl+e.showAction+"?"+e.idName+"\x3d"+c.rowId+e.addParam;return a.fmatter.isString(d)||a.fmatter.isNumber(d)?"\x3ca "+f+' href\x3d"'+e+'"\x3e'+d+"\x3c/a\x3e":a.fn.fmatter.defaultFormat(d,c)};a.fn.fmatter.integer=function(d,c){var e=a.extend({},c.integer);void 0!==c.colModel&&void 0!==c.colModel.formatoptions&&(e=a.extend({},e,c.colModel.formatoptions));return a.fmatter.isEmpty(d)?e.defaultValue:
a.fmatter.util.NumberFormat(d,e)};a.fn.fmatter.number=function(d,c){var e=a.extend({},c.number);void 0!==c.colModel&&void 0!==c.colModel.formatoptions&&(e=a.extend({},e,c.colModel.formatoptions));return a.fmatter.isEmpty(d)?e.defaultValue:a.fmatter.util.NumberFormat(d,e)};a.fn.fmatter.currency=function(d,c){var e=a.extend({},c.currency);void 0!==c.colModel&&void 0!==c.colModel.formatoptions&&(e=a.extend({},e,c.colModel.formatoptions));return a.fmatter.isEmpty(d)?e.defaultValue:a.fmatter.util.NumberFormat(d,
e)};a.fn.fmatter.date=function(d,c,e,f){e=a.extend({},c.date);void 0!==c.colModel&&void 0!==c.colModel.formatoptions&&(e=a.extend({},e,c.colModel.formatoptions));return e.reformatAfterEdit||"edit"!==f?a.fmatter.isEmpty(d)?a.fn.fmatter.defaultFormat(d,c):a.jgrid.parseDate(e.srcformat,d,e.newformat,e):a.fn.fmatter.defaultFormat(d,c)};a.fn.fmatter.select=function(d,c){d=String(d);var e=!1,f=[],h,b;void 0!==c.colModel.formatoptions?(e=c.colModel.formatoptions.value,h=void 0===c.colModel.formatoptions.separator?
":":c.colModel.formatoptions.separator,b=void 0===c.colModel.formatoptions.delimiter?";":c.colModel.formatoptions.delimiter):void 0!==c.colModel.editoptions&&(e=c.colModel.editoptions.value,h=void 0===c.colModel.editoptions.separator?":":c.colModel.editoptions.separator,b=void 0===c.colModel.editoptions.delimiter?";":c.colModel.editoptions.delimiter);if(e){var g=!0===(null!=c.colModel.editoptions&&!0===c.colModel.editoptions.multiple)?!0:!1,k=[];g&&(k=d.split(","),k=a.map(k,function(b){return a.trim(b)}));
if(a.fmatter.isString(e)){var l=e.split(b),m=0,n;for(n=0;n




© 2015 - 2025 Weber Informatics LLC | Privacy Policy