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

template.js.plugins.grid.inlinedit.min.js Maven / Gradle / Ivy

There is a newer version: 5.0.6
Show newest version
'use strict';(function(a){a.jgrid.inlineEdit=a.jgrid.inlineEdit||{};a.jgrid.extend({editRow:function(c,e,b,m,l,n,q,g,d){var h={},f=a.makeArray(arguments).slice(1);"object"===a.type(f[0])?h=f[0]:(void 0!==e&&(h.keys=e),a.isFunction(b)&&(h.oneditfunc=b),a.isFunction(m)&&(h.successfunc=m),void 0!==l&&(h.url=l),void 0!==n&&(h.extraparam=n),a.isFunction(q)&&(h.aftersavefunc=q),a.isFunction(g)&&(h.errorfunc=g),a.isFunction(d)&&(h.afterrestorefunc=d));h=a.extend(!0,{keys:!1,oneditfunc:null,successfunc:null,
url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:!0,mtype:"POST",focusField:!0},a.jgrid.inlineEdit,h);return this.each(function(){var d=this,f,e,b,g=0,l=null,n={},m,p;d.grid&&(m=a(d).jqGrid("getInd",c,!0),!1!==m&&(b=a.isFunction(h.beforeEditRow)?h.beforeEditRow.call(d,h,c):void 0,void 0===b&&(b=!0),b&&(b=a(m).attr("editable")||"0","0"!==b||a(m).hasClass("not-editable-row")||(p=d.p.colModel,a('td[role\x3d"gridcell"]',m).each(function(b){f=p[b].name;var h=
!0===d.p.treeGrid&&f===d.p.ExpandColumn;if(h)e=a("span:first",this).html();else try{e=a.unformat.call(d,this,{rowId:c,colModel:p[b]},b)}catch(m){e=p[b].edittype&&"textarea"===p[b].edittype?a(this).text():a(this).html()}if("cb"!==f&&"subgrid"!==f&&"rn"!==f&&(d.p.autoencode&&(e=a.jgrid.htmlDecode(e)),n[f]=e,!0===p[b].editable)){null===l&&(l=b);h?a("span:first",this).html(""):a(this).html("");var q=a.extend({},p[b].editoptions||{},{id:c+"_"+f,name:f,rowId:c});p[b].edittype||(p[b].edittype="text");if("\x26nbsp;"===
e||"\x26#160;"===e||1===e.length&&160===e.charCodeAt(0))e="";var x=a.jgrid.createEl.call(d,p[b].edittype,q,e,!0,a.extend({},a.jgrid.ajaxOptions,d.p.ajaxSelectOptions||{}));a(x).addClass("editable");h?a("span:first",this).append(x):a(this).append(x);a.jgrid.bindEv.call(d,x,q);"select"===p[b].edittype&&void 0!==p[b].editoptions&&!0===p[b].editoptions.multiple&&void 0===p[b].editoptions.dataUrl&&a.jgrid.msie&&a(x).width(a(x).width());g++}}),0




© 2015 - 2024 Weber Informatics LLC | Privacy Policy