!function(t,i){"use strict";"function"==typeof define&&define.amd?define(["jquery","./grid.base","free-jqgrid-plugins/ui.multiselect","jquery-ui/dialog","jquery-ui/draggable","jquery-ui/droppable","jquery-ui/resizable","jquery-ui/sortable"],function(e){return i(e,t,t.document)}):"object"==typeof module&&module.exports?module.exports=function(e,t){return e||(e=window),void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),require("./grid.base"),require("free-jqgrid-plugins/ui.multiselect"),require("jquery-ui/dialog"),require("jquery-ui/draggable"),require("jquery-ui/droppable"),require("jquery-ui/resizable"),require("jquery-ui/sortable"),i(t,e,e.document),t}:i(jQuery,t,t.document)}("undefined"!=typeof window?window:this,function(G,x,s){"use strict";var C=G.jgrid,F=C.jqID,z=null!=G.ui?G.ui.multiselect:null,H=function(i){if(null!=this.grid&&null!=this.grid.p){var o,e,t,r,n,a=this,d=this.grid.p,l=this.gh,s=this.selectedList,u=this.inGroup,c=s.find("li"),p=c.length-1,h=function(e,t,i){var o,r,n=s.find("li");for(void 0===t&&(t=i?n.length-1:0),o=t;i?0<=o:o=c.length||e<0)return;if((n=G(c[e+1]).data("optionLink"))&&void 0!==(t=u[parseInt(n.val(),10)])&&(n=G(c[e-1]).data("optionLink"))&&u[parseInt(n.val(),10)]===t){var v=h(function(e){if(u[e]!==t)return!0},e+1);G(c[void 0===v||v>=c.length?c.length-1:v-1]).after(c[p]),g()}}}};if(C.msie&&8===C.msiever()&&(G.expr[":"].hidden=function(e){return 0===e.offsetWidth||0===e.offsetHeight||"none"===e.style.display}),C._multiselect=!1,z){if(z.prototype._setSelected){var n=z.prototype._setSelected;z.prototype._setSelected=function(e,t){var i=n.call(this,e,t),o=this.element,r=parseInt(e.data("optionLink").val(),10);return t&&this.selectedList&&(H.call(this,r),this.selectedList.find("li").each(function(){G(this).data("optionLink")&&G(this).data("optionLink").remove().appendTo(o)})),i}}z.prototype.destroy&&(z.prototype.destroy=function(){var e=this;e.element.show(),e.container.remove(),void 0===G.Widget?G.widget.prototype.destroy.apply(e,arguments):G.Widget.prototype.destroy.apply(e,arguments)}),C._multiselect=!0}C.extend({sortableColumns:function(l){return this.each(function(){var n=this,a=n.p,e=F(a.id);if(a&&a.sortable&&G.isFunction(G.fn.sortable)){var t={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_"+e+"_cb,#jqgh_"+e+"_rn,#jqgh_"+e+"_subgrid),:hidden)",placeholder:{element:function(e){return G(s.createElement(e[0].nodeName)).addClass(e[0].className+" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(e,t){t.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),t.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}},start:function(){n.grid.hDiv.scrollLeft=n.grid.bDiv.scrollLeft},update:function(e,t){var i=G(">th",G(t.item).parent()),o=a.id+"_",r=[];i.each(function(){var e=G(">div",this).get(0).id.replace(/^jqgh_/,"").replace(o,""),t=a.iColByName[e];void 0!==t&&r.push(t)}),G(n).jqGrid("remapColumns",r,!0,!0),G.isFunction(a.sortable.update)&&a.sortable.update(r),setTimeout(function(){a.disableClick=!1},50)}};if(a.sortable.options?G.extend(t,a.sortable.options):G.isFunction(a.sortable)&&(a.sortable={update:a.sortable}),t.start){var i=t.start;t.start=function(e,t){d(),i.call(this,e,t)}}else t.start=d;a.sortable.exclude&&(t.items+=":not("+a.sortable.exclude+")");var o=l.sortable(t),r=o.data("sortable")||o.data("uiSortable")||o.data("ui-sortable");null!=r&&(r.floating=!0)}function d(){a.disableClick=!0}})},columnChooser:function(n){var t,a,e,i,o,d,r,l=this,s=l[0],u=s.p,c=u.colModel,p=c.length,h=u.colNames,g=function(e){return z&&z.prototype&&e.data(z.prototype.widgetFullName||z.prototype.widgetName)||e.data("ui-multiselect")||e.data("multiselect")};if(!G("#colchooser_"+F(u.id)).length){if(t=G('
'),a=G("select",t),n=G.extend({width:400,height:240,classname:null,done:function(e){e&&l.jqGrid("remapColumns",e,!0)},msel:"multiselect",dlog:"dialog",dialog_opts:{minWidth:470,dialogClass:"ui-jqdialog"},dlog_opts:function(e){var t={};return t[e.bSubmit]=function(){e.apply_perm(),e.cleanup(!1)},t[e.bCancel]=function(){e.cleanup(!0)},G.extend(!0,{buttons:t,close:function(){e.cleanup(!0)},modal:e.modal||!1,resizable:e.resizable||!0,width:e.width+70,resize:function(){var e=g(a),t=e.container.closest(".ui-dialog-content");0div",t).css({width:n.width,margin:"0 auto"}),a.css("width",n.width)),n.height&&(G(">div",t).css("height",n.height),a.css("height",n.height-10)),a.empty();var f,m,b,v,y=null!=u.groupHeader?u.groupHeader.groupHeaders:0,w={};if(y)for(f=0;f"+w[e]+"")}),e=G.isFunction(n.dlog_opts)?n.dlog_opts.call(l,n):n.dlog_opts,q(n.dlog,t,e),i=G.isFunction(n.msel_opts)?n.msel_opts.call(l,n):n.msel_opts,q(n.msel,a,i),(o=G("#colchooser_"+F(u.id))).css({margin:"auto"}),o.find(">div").css({width:"100%",height:"100%",margin:"auto"}),d=g(a)){var _,j;if(d.grid=s,y)for(d.gh=G.extend(!0,[],y),d.inGroup=new Array(u.colModel.length),_=0;_tbody>.jqgrow"},a||{})).start&&G.isFunction(a.start)?(a._start_=a.start,delete a.start):a._start_=!1,a.update&&G.isFunction(a.update)?(a._update_=a.update,delete a.update):a._update_=!1,a.start=function(e,t){if(G(t.item).css("border-width","0"),G("td",t.item).each(function(e){this.style.width=r.cols[e].style.width}),n.subGrid){var i=G(t.item).attr("id");try{G(o).jqGrid("collapseSubGridRow",i)}catch(e){}}a._start_&&a._start_.apply(this,[e,t])},a.update=function(e,t){G(t.item).css("border-width",""),!0===n.rownumbers&&G("td.jqgrid-rownum",o.rows).each(function(e){G(this).html(e+1+(parseInt(n.page,10)-1)*parseInt(n.rowNum,10))}),a._update_&&a._update_.apply(this,[e,t])},G(o).sortable(a)))})},gridDnD:function(o){return this.each(function(){var e,t,f=this;if(f.grid&&!f.p.treeGrid&&G.fn.draggable&&G.fn.droppable){if(void 0===G("#jqgrid_dnd")[0]&&G("body").append("
"),"string"!=typeof o||"updateDnD"!==o||!0!==f.p.jqgdnd){if((o=G.extend({drag:function(r){return G.extend({start:function(e,t){var i,o;if(f.p.subGrid){o=G(t.helper).attr("id");try{G(f).jqGrid("collapseSubGridRow",o)}catch(e){}}for(i=0;i.ui-jqgrid-bdiv",d=!1,l=n.height;if(r&&G.fn.resizable){if((s=G.extend({},s||{})).alsoResize?(s._alsoResize_=s.alsoResize,delete s.alsoResize):s._alsoResize_=!1,s.stop&&G.isFunction(s.stop)?(s._stop_=s.stop,delete s.stop):s._stop_=!1,s.stop=function(e,t){G(o).jqGrid("setGridWidth",t.size.width,s.shrinkToFit),G(n.gView+">.ui-jqgrid-titlebar").css("width",""),d?(G(i).each(function(){G(this).css("height","")}),"auto"!==l&&"100%"!==l||G(r.bDiv).css("height",l)):G(o).jqGrid("setGridParam",{height:G(a).height()}),o.fixScrollOffsetAndhBoxPadding&&o.fixScrollOffsetAndhBoxPadding(),s._stop_&&s._stop_.call(o,e,t)},i=a,"auto"!==l&&"100%"!==l||void 0!==s.handles||(s.handles="e,w"),s.handles){var e=G.map(String(s.handles).split(","),function(e){return G.trim(e)});2===e.length&&("e"===e[0]&&"w"===e[1]||"e"===e[1]&&"w"===e[1])&&(i=n.gView+">div:not(.frozen-div)",d=!0,n.pager&&(i+=","+n.pager))}s._alsoResize_?s.alsoResize=i+","+s._alsoResize_:s.alsoResize=i,delete s._alsoResize_,G(n.gBox).resizable(s)}})}})}); //# sourceMappingURL=grid.jqueryui.js.map