template.js.plugins.grid.inlinedit.min.js Maven / Gradle / Ivy
'use strict';(function(c){"function"===typeof define&&define.amd?define(["jquery","./grid.base","./jquery.fmatter","./grid.common"],c):"object"===typeof module&&module.exports?module.exports=function(h,z){h||(h=window);void 0===z&&(z="undefined"!==typeof window?require("jquery"):require("jquery")(h));require("./grid.base");require("./jquery.fmatter");require("./grid.common");c(z);return z}:c(jQuery)})(function(c){var h=c.jgrid,z=h.fullBoolFeedback,C=h.hasOneFromClasses,Q=c.fn.jqGrid,H=function(c){return Q.getGuiStyles.call(this,
"states."+c)},F=function(d){var l=c.makeArray(arguments).slice(1);l.unshift("");l.unshift("Inline");l.unshift(d);return h.feedback.apply(this,l)};h.inlineEdit=h.inlineEdit||{};h.extend({editRow:function(d,l,q,g,b,k,v,t,f,a){var e={},n=c.makeArray(arguments).slice(1);"object"===c.type(n[0])?e=n[0]:(void 0!==l&&(e.keys=l),c.isFunction(q)&&(e.oneditfunc=q),c.isFunction(g)&&(e.successfunc=g),void 0!==b&&(e.url=b),null!=k&&(e.extraparam=k),c.isFunction(v)&&(e.aftersavefunc=v),c.isFunction(t)&&(e.errorfunc=
t),c.isFunction(f)&&(e.afterrestorefunc=f),c.isFunction(a)&&(e.beforeEditRow=a));return this.each(function(){var a=this,b=c(a),g=a.p,f=0,k=null,l={},q={},n=g.colModel,p=g.prmNames;if(a.grid){var w=c.extend(!0,{keys:!1,oneditfunc:null,successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:!0,beforeEditRow:null,focusField:!0},h.inlineEdit,g.inlineEditing||{},e),v=b.jqGrid("getInd",d,!0),t=w.focusField,x="object"===typeof t&&null!=t?c(t.target||
t).closest("tr.jqgrow\x3etd")[0]:null;if(!1!==v&&(w.extraparam[p.oper]===p.addoper||F.call(a,w,"beforeEditRow",w,d))&&"0"===(c(v).attr("editable")||"0")&&!c(v).hasClass("not-editable-row")){p=h.detectRowEditing.call(a,d);if(null!=p&&"cellEditing"===p.mode){var p=p.savedRow,B=a.rows[p.id],G=H.call(a,"select");b.jqGrid("restoreCell",p.id,p.ic);c(B.cells[p.ic]).removeClass("edit-cell "+G);c(B).addClass(G).attr({"aria-selected":"true",tabindex:"0"})}h.enumEditableCells.call(a,v,c(v).hasClass("jqgrid-new-row")?
"add":"edit",function(b){var m=b.cm,e=c(b.dataElement),v=b.dataWidth,r,J=m.name,t=m.edittype,n=b.iCol,p=m.editoptions||{};q[J]=b.editable;if("hidden"!==b.editable){try{r=c.unformat.call(this,b.td,{rowId:d,colModel:m},n)}catch(S){r="textarea"===t?e.text():e.html()}l[J]=r;e.html("");m=c.extend({},p,{id:d+"_"+J,name:J,rowId:d,mode:b.mode,cm:m,iCol:n});if("\x26nbsp;"===r||"\x26#160;"===r||1===r.length&&160===r.charCodeAt(0))r="";r=h.createEl.call(a,t,m,r,!0,c.extend({},h.ajaxOptions,g.ajaxSelectOptions||
{}));c(r).addClass("editable");e.append(r);v&&c(r).width(b.dataWidth);h.bindEv.call(a,r,m);"select"===t&&!0===p.multiple&&void 0===p.dataUrl&&h.msie&&c(r).width(c(r).width());null===k&&(k=n);f++}});0b.status||304===b.status)&&(0!==b.status||4!==b.readyState)){var k,f;f=n.triggerHandler("jqGridInlineSuccessSaveRow",[b,d,a,D,p]);if(null==f||!0===f)f=[!0,u];f[0]&&y(a.successfunc)&&(f=a.successfunc.call(e,b,d,a,D,p));c.isArray(f)?(k=f[0],u=f[1]||u):k=f;if(!0===k){m.autoEncodeOnEdit&&c.each(u,function(a,b){u[a]=h.oldDecodePostedData(b)});
u=c.extend({},u,K);n.jqGrid("setRowData",d,u);B.attr("editable","0");for(g=0;g=k.length))){0>=k.find(".navtable").length&&g.jqGrid("navGrid",d,{add:!1,edit:!1,del:!1,search:!1,refresh:!1,view:!1});b._inlinenav=!0;if(!0===a.addParams.useFormatter){k=b.colModel;var e,n;for(e=0;e
© 2015 - 2025 Weber Informatics LLC | Privacy Policy