www-thermferm/jqwidgets/jqxgrid.edit.js

changeset 617
b216f9d4b917
parent 511
2d1d43c3a2c2
--- a/www-thermferm/jqwidgets/jqxgrid.edit.js	Sun Jul 10 16:58:40 2022 +0200
+++ b/www-thermferm/jqwidgets/jqxgrid.edit.js	Mon Aug 08 10:54:27 2022 +0200
@@ -1,8 +1,9 @@
 /*
-jQWidgets v4.5.2 (2017-May)
-Copyright (c) 2011-2017 jQWidgets.
-License: http://jqwidgets.com/license/
-*/
-!function(a){a.extend(a.jqx._jqxGrid.prototype,{_handledblclick:function(b,c){if(null!=b.target&&!c.disabled&&!a(b.target).ischildof(this.columnsheader)){var d;if(b.which?d=3==b.which:b.button&&(d=2==b.button),!d){var e;if(b.which?e=2==b.which:b.button&&(e=1==b.button),!e){var f=this.showheader?this.columnsheader.height()+2:0,g=this._groupsheader()?this.groupsheader.height():0,h=this.showtoolbar?this.toolbarheight:0;g+=h;var i=this.host.offset(),j=b.pageX-i.left,k=b.pageY-f-i.top-g,l=this._hittestrow(j,k);if(l){var m=l.row,n=l.index,o=b.target.className,p=this.table[0].rows[n];if(null!=p){c.mousecaptured=!0,c.mousecaptureposition={left:b.pageX,top:b.pageY-g};for(var q=this.hScrollInstance,r=q.value,s=0,t=(this.groupable?this.groups.length:0,0);t<p.cells.length;t++){var u=parseInt(a(this.columnsrow[0].cells[t]).css("left")),v=u-r;c.columns.records[t].pinned&&(v=u);var w=this._getcolumnat(t);if(null==w||!w.hidden){var x=v+a(this.columnsrow[0].cells[t]).width();if(x>=j&&j>=v){s=t;break}}}if(null!=m){var w=this._getcolumnat(s);o.indexOf("jqx-grid-group-expand")==-1&&o.indexOf("jqx-grid-group-collapse")==-1&&m.boundindex!=-1&&c.begincelledit(c.getboundindex(m),w.datafield,w.defaulteditorvalue)}}}}}}},_getpreveditablecolumn:function(a){for(var b=this;a>0;){a--;var c=b.getcolumnat(a);if(!c)return null;if(c.editable&&!c.hidden)return c}return null},_getnexteditablecolumn:function(a){for(var b=this;a<this.columns.records.length;){a++;var c=b.getcolumnat(a);if(!c)return null;if(c.editable&&!c.hidden)return c}return null},_handleeditkeydown:function(b,c){if(c.handlekeyboardnavigation){var d=c.handlekeyboardnavigation(b);if(1==d)return!0}var e=b.charCode?b.charCode:b.keyCode?b.keyCode:0;if(c.editEvent=b,c.showfilterrow&&c.filterable&&this.filterrow&&a(b.target).ischildof(this.filterrow))return!0;if(b.target.className&&b.target.className.indexOf("jqx-grid-widget")>=0)return!0;if(c.pageable&&a(b.target).ischildof(this.pager))return!0;if(this.showtoolbar&&a(b.target).ischildof(this.toolbar))return!0;if(this.showeverpresentrow){if(this.addnewrowtop&&a(b.target).ischildof(this.addnewrowtop))return!0;if(this.addnewrowbottom&&a(b.target).ischildof(this.addnewrowbottom))return!0}if(this.showstatusbar&&a(b.target).ischildof(this.statusbar))return!0;if(this.rowdetails&&a(b.target).ischildof(this.content.find("[role='rowgroup']")))return!0;if(this.editcell){if("selectedrow"===this.editmode){if(13===e)return this.endrowedit(this.editcell.row,!1),!1;if(27===e)return this.endrowedit(this.editcell.row,!0),!1;if(32==e&&this._currentColumn&&"checkbox"==this.getcolumn(this._currentColumn).columntype){var f=this.getcolumn(this._currentColumn);if(f.editable){var g=!this.getcellvalue(this.editcell.row,f.datafield),h=this.getrowdata(this.editcell.row),i=this.editcell.row,h=c.getrowdata(c.editcell.row);this.setcellvalue(this.editcell.row,f.datafield,g,!1);var j=this._focusedColumn,k=this._currentColumn,l=this._currentEditableColumn;if(this.endrowedit(this.editcell.row,!1),this.beginrowedit(i,!1),this._currentColumn=k,this._focusedColumn=j,this._currentEditableColumn=l,this._renderrows(),this.selectcell(i,f.datafield),this._oldselectedcell=this.selectedcell,j){var m=this;setTimeout(function(){m.selectcell(i,f.datafield),m._oldselectedcell=m.selectedcell,a(m._checkboxCells[f.datafield].checkbox).jqxCheckBox("focus")},25)}return!1}}if(9===e){var n=this.editcell.datafield,o=this._getcolumnindex(n);this._currentEditableColumn?o=this._currentEditableColumn:this._currentEditableColumn=o;var f=this._getnexteditablecolumn(o);if(b.shiftKey&&(f=this._getpreveditablecolumn(o)),f){var o=this._getcolumnindex(f.datafield);if(this.editcell[f.datafield]){this._currentEditableColumn=o;var p=this.editcell[f.datafield].editor;p&&(p.data().jqxWidget&&p.data().jqxWidget.focus?p.data().jqxWidget.focus():p.focus()),this._focusedColumn=f.datafield,this._currentColumn=f.datafield}else if("checkbox"==f.columntype)return this._currentColumn=f.datafield,this._currentEditableColumn=o,this.selectcell(this.editcell.row,f.datafield),this._oldselectedcell=this.selectedcell,this._checkboxCells[f.datafield]&&a(this._checkboxCells[f.datafield].checkbox).jqxCheckBox("focus"),!1}return!1}return!0}if(null==this.editcell.columntype||"textbox"==this.editcell.columntype||"numberinput"==this.editcell.columntype||"combobox"==this.editcell.columntype||"datetimeinput"==this.editcell.columntype){if(e>=33&&e<=40&&"multiplecellsadvanced"==c.selectionmode){var p="textbox"==this.editcell.columntype||null==this.editcell.columntype?this.editcell.editor:this.editcell.editor.find("input"),q=c._selection(p),r=p.val().length;q.length>0&&"datetimeinput"!=this.editcell.columntype&&(c._cancelkeydown=!0),q.start>0&&37==e&&(c._cancelkeydown=!0),q.start<r&&39==e&&"datetimeinput"!=this.editcell.columntype&&(c._cancelkeydown=!0),"datetimeinput"==this.editcell.columntype&&39==e&&q.start+q.length<r&&(c._cancelkeydown=!0)}}else"dropdownlist"==this.editcell.columntype?(37==e||39==e&&"multiplecellsadvanced"==c.selectionmode)&&(c._cancelkeydown=!1):"multiplecellsadvanced"==this.selectionmode&&"textbox"!=this.editcell.columntype&&"numberinput"!=this.editcell.columntype&&(c._cancelkeydown=!0);if(32==e&&"checkbox"==c.editcell.columntype){var f=c.getcolumn(c.editcell.datafield);if(f.editable){var g=!c.getcellvalue(c.editcell.row,c.editcell.column);if(f.cellbeginedit){var s=f.cellbeginedit(c.editcell.row,f.datafield,f.columntype,!g);if(0==s)return!1}var h=c.getrowdata(c.editcell.row);return c.setcellvalue(c.editcell.row,c.editcell.column,g,!0),c._raiseEvent(18,{rowindex:c.editcell.row,row:h,datafield:c.editcell.column,oldvalue:!g,value:g,columntype:"checkbox"}),!1}}if(9==e){var t=this.editcell.row,n=this.editcell.column,u=n,o=c._getcolumnindex(n),v=!1,w=c.getrowvisibleindex(t);this.editchar="";var x=this.editcell.validated;if(!this.editcell.validated)var x=this.endcelledit(this.editcell.row,this.editcell.column,!1,!0,!1);if(0!=x){if(b.shiftKey){var f=c._getpreveditablecolumn(o);if(f)n=f.datafield,v=!0,c.selectionmode.indexOf("cell")!=-1&&(c.selectprevcell(t,u),c._oldselectedcell=c.selectedcell,setTimeout(function(){c.ensurecellvisible(w,n)},10));else{var y=c._getlastvisiblecolumn();v=!0,n=y.displayfield,t--,c.selectionmode.indexOf("cell")!=-1&&(c.clearselection(),c.selectcell(t,n),c._oldselectedcell=c.selectedcell,setTimeout(function(){c.ensurecellvisible(w,n)},10))}}else{var f=c._getnexteditablecolumn(o);if(f)n=f.datafield,v=!0,c.selectionmode.indexOf("cell")!=-1&&(c.selectnextcell(t,u),c._oldselectedcell=c.selectedcell,setTimeout(function(){c.ensurecellvisible(w,n)},10));else{var z=c._getfirstvisiblecolumn();v=!0,n=z.displayfield,t++,c.selectionmode.indexOf("cell")!=-1&&(c.clearselection(),c.selectcell(t,n),c._oldselectedcell=c.selectedcell,setTimeout(function(){c.ensurecellvisible(w,n)},10))}}if(!v)return null!=this.editcell&&(c.endcelledit(t,n,!1),this._renderrows(this.virtualsizeinfo)),!0;c.begincelledit(t,n),null!=this.editcell&&"checkbox"==this.editcell.columntype&&this._renderrows(this.virtualsizeinfo)}return!1}if(13==e){var A=this.selectedcell;if(A)var B=this.getrowvisibleindex(A.rowindex);if(this.endcelledit(this.editcell.row,this.editcell.column,!1,!0),"multiplecellsadvanced"==this.selectionmode){var C=c.getselectedcell();if(null!=C&&c.selectcell&&null==this.editcell&&C.rowindex+1<this.dataview.totalrecords)if(this.sortcolumn!=C.datafield){var w=this.getrowvisibleindex(C.rowindex),D=this.dataview.loadedrecords[w+1];if(D&&(!this.pageable||this.pageable&&w+1<(this.dataview.pagenum+1)*this.pagesize)){this.clearselection(!1),this.selectcell(this.getboundindex(D),C.datafield);var C=this.getselectedcell();this.ensurecellvisible(D.visibleindex,C.datafield)}}else if(null!=A){var E=this.dataview.loadedrecords[B+1];if(E)if(!this.pageable||this.pageable&&B+1<this.pagesize)this.clearselection(!1),this.selectcell(this.getboundindex(E),C.datafield);else if(this.pageable&&B+1>=this.pagesize){this.clearselection(!1);var E=this.dataview.loadedrecords[B];this.selectcell(this.getboundindex(E),C.datafield)}}}return!1}if(27==e)return this.endcelledit(this.editcell.row,this.editcell.column,!0,!0),!1}else{var F=!1;if(113==e&&(F=!0),!b.ctrlKey&&!b.altKey&&!b.metaKey){if(e>=48&&e<=57&&(this.editchar=String.fromCharCode(e),F=!0),189===e&&(F=!0),e>=65&&e<=90){this.editchar=String.fromCharCode(e);var G=!1;b.shiftKey?G=b.shiftKey:b.modifiers&&(G=!!(4&b.modifiers)),G||(this.editchar=this.editchar.toLowerCase()),F=!0}else e>=96&&e<=105&&(this.editchar=e-96,this.editchar=this.editchar.toString(),F=!0);var H=a(".jqx-grid").length;F=F&&(1==H||H>1&&c.focused);var I=a.data(document.body,"jqxgrid.edit");if(void 0!==I&&""!==I&&(13===e||F)&&I!=c.element.id)return!0}if((13==e||F)&&c.getselectedrowindex){var t=c.getselectedrowindex();if("selectedrow"===c.editmode)return c.beginrowedit(t),!1;switch(c.selectionmode){case"singlerow":case"multiplerows":case"multiplerowsextended":if(t>=0){for(var n="",J=0;J<c.columns.records.length;J++){var f=c.getcolumnat(J);if(f.editable){n=f.datafield;break}}"selectedrow"===c.editmode?c.beginrowedit(t):c.begincelledit(t,n)}break;case"singlecell":case"multiplecells":case"multiplecellsextended":var C=c.getselectedcell();if(null!=C){var f=c._getcolumnbydatafield(C.datafield);"checkbox"!=f.columntype&&c.begincelledit(C.rowindex,C.datafield)}break;case"multiplecellsadvanced":var C=c.getselectedcell();if(null!=C)if(13==e){if(c.selectcell){var w=this.getrowvisibleindex(C.rowindex);if(w+1<c.dataview.totalrecords){var D=this.dataview.loadedrecords[w+1];if(D){this.clearselection(!1),this.selectcell(this.getboundindex(D),C.datafield);var C=this.getselectedcell();this.ensurecellvisible(D.visibleindex,C.datafield)}}}}else"selectedrow"!==c.editmode&&c.begincelledit(C.rowindex,C.datafield)}return!1}if(46==e){var K=c.getselectedcells();if(c.selectionmode.indexOf("cell")==-1&&c._getcellsforcopypaste&&(K=c._getcellsforcopypaste()),null!=K&&K.length>0){for(var L=0;L<K.length;L++){var C=K[L];if(C.datafield){var f=c.getcolumn(C.datafield),M=c.getcellvalue(C.rowindex,C.datafield);if(""!==M&&f.editable&&c.enablekeyboarddelete){var N=null;if("checkbox"==f.columntype&&(f.threestatecheckbox||(N=!1)),f.cellbeginedit){var s=f.cellbeginedit(C.rowindex,f.datafield,f.columntype,N);if(0==s)return!1}var h=c.getrowdata(C.rowindex);if(c._raiseEvent(17,{rowindex:C.rowindex,row:h,datafield:C.datafield,value:M}),L==K.length-1?(c.setcellvalue(C.rowindex,C.datafield,N,!0),f.displayfield!=f.datafield&&c.setcellvalue(C.rowindex,f.displayfield,N,!0)):(c.setcellvalue(C.rowindex,C.datafield,N,!1),f.displayfield!=f.datafield&&c.setcellvalue(C.rowindex,f.displayfield,N,!0)),f.cellendedit){f.cellendedit(C.rowindex,f.datafield,f.columntype,N)}c._raiseEvent(18,{rowindex:C.rowindex,row:h,datafield:C.datafield,oldvalue:M,value:N})}}}return this.dataview.updateview(),this._renderrows(this.virtualsizeinfo),!1}}if(32==e){var C=c.getselectedcell();if(null!=C){var f=c.getcolumn(C.datafield);if("checkbox"==f.columntype&&f.editable){var g=!c.getcellvalue(C.rowindex,C.datafield);if(f.cellbeginedit){var s=f.cellbeginedit(C.rowindex,f.datafield,f.columntype,!g);if(0==s)return!1}var h=c.getrowdata(C.rowindex);return c._raiseEvent(17,{rowindex:C.rowindex,row:h,datafield:C.datafield,value:!g,columntype:"checkbox"}),c.setcellvalue(C.rowindex,C.datafield,g,!0),c._raiseEvent(18,{rowindex:C.rowindex,row:h,datafield:C.datafield,oldvalue:!g,value:g,columntype:"checkbox"}),!1}}}}return!0},begincelledit:function(b,c,d,e,f){var g=this.getcolumn(c);if(this._cellscache=new Array,null!=c&&"number"!=g.columntype&&"button"!=g.columntype&&!g.createwidget){if(this.groupable){if(this.groups.indexOf(c)>=0)return;if(this.groups.indexOf(g.displayfield)>=0)return}if(void 0==this.editrow){if(this.editcell){if(this.editcell.row==b&&this.editcell.column==c)return!0;if("selectedrow"===this.editmode&&this.editcell.row==b)return;var h=this.endcelledit(this.editcell.row,this.editcell.column,!1,!0,!1);if(0==h)return}var i="checkbox"==g.columntype||"button"==g.columntype||g.createwidget;if(this.host.removeClass("jqx-disableselect"),this.content.removeClass("jqx-disableselect"),g.editable){if(g.cellbeginedit){var j=this.getcell(b,c),k=g.cellbeginedit(b,c,g.columntype,null!=j?j.value:null);if(0==k)return}var l=this.getrowvisibleindex(b);if(this.editcell=this.getcell(b,c),this.editcell&&(this.editcell.visiblerowindex=l,!this.editcell.editing)){if(i||(this.editcell.editing=!0),this.editcell.columntype=g.columntype,this.editcell.defaultvalue=d,void 0!=g.defaultvalue&&(this.editcell.defaultvalue=g.defaultvalue),this.editcell.init=!0,"checkbox"!=g.columntype&&"selectedrow"!=this.editmode){var m=this.getrowdata(b);this._raiseEvent(17,{rowindex:b,row:m,datafield:g.datafield,value:this.editcell.value,columntype:g.columntype})}if(a.data(document.body,"jqxgrid.edit",this.element.id),!i){var n=this.getrowvisibleindex(b);e!==!1&&(this.autorowheight||this.ensurecellvisible(n,g.datafield)),f!==!1&&this._renderrows(this.virtualsizeinfo)}if(this.editcell)return this.editcell.init=!1,!0}}else{if(!this.editcell)return;this.editcell.editor=null,this.editcell.editing=!1,f!==!1&&this._renderrows(this.virtualsizeinfo),this.editcell=null}}}},getScrollTop:function(){if(this._py)return pageYOffset;if(this._py="undefined"!=typeof pageYOffset,this._py)return pageYOffset;var a=document.body,b=document.documentElement;return b=b.clientHeight?b:a,b.scrollTop},getScrollLeft:function(){if("undefined"!=typeof pageXOffset)return pageXOffset;var a=document.body,b=document.documentElement;return b=b.clientHeight?b:a,b.scrollLeft},endcelledit:function(b,c,d,e,f){if(void 0!=b&&void 0!=c||(this.editcell&&(b=this.editcell.row,c=this.editcell.column),void 0==d&&(d=!0)),this.editcell){var g=this.getcolumn(c),h=this;if("selectedrow"===h.editmode)return void this.endrowedit(b,d);var i=function(){if(0!=f){if(h.isTouchDevice())return;if(!h.isNestedGrid){var a=h.getScrollTop(),b=h.getScrollLeft();try{h.element.focus(),h.content.focus(),a!=h.getScrollTop()&&window.scrollTo(b,a),setTimeout(function(){h.element.focus(),h.content.focus(),a!=h.getScrollTop()&&window.scrollTo(b,a)},10)}catch(a){}}}};if("checkbox"==g.columntype||"button"==g.columntype||g.createwidget)return this.editcell&&(this.editcell.editor=null,this.editcell.editing=!1,this.editcell=null),!0;var j=this._geteditorvalue(g),k=function(a){if(a._hidecelleditor(),g.cellendedit&&g.cellendedit(b,c,g.columntype,a.editcell.value,j),a.editchar=null,g.displayfield!=g.datafield){var d=a.getcellvalue(a.editcell.row,g.displayfield),f=a.editcell.value;oldvalue={value:f,label:d}}else oldvalue=a.editcell.value;var h=a.getrowdata(b);a._raiseEvent(18,{rowindex:b,row:h,datafield:c,displayfield:g.displayfield,oldvalue:j,value:j,columntype:g.columntype}),a.editcell.editor=null,a.editcell.editing=!1,a.editcell=null,(e||void 0==e)&&a._renderrows(a.virtualsizeinfo),i(),a.enablebrowserselection||(a.host.addClass("jqx-disableselect"),a.content.addClass("jqx-disableselect"))};if(d)return k(this),!1;if(this.validationpopup&&(this.validationpopup.hide(),this.validationpopuparrow.hide()),g.cellvaluechanging){var l=g.cellvaluechanging(b,c,g.columntype,this.editcell.value,j);void 0!=l&&(j=l)}if(g.validation){var m=this.getcell(b,c);try{var n=g.validation(m,j),o=this.gridlocalization.validationstring;void 0!=n.message&&(o=n.message);var p="boolean"==typeof n?n:n.result;if(!p)return void 0!=n.showmessage&&1!=n.showmessage||this._showvalidationpopup(b,c,o),this.editcell.validated=!1,!1}catch(a){return this._showvalidationpopup(b,c,this.gridlocalization.validationstring),this.editcell.validated=!1,!1}}if(g.displayfield!=g.datafield){var q=this.getcellvalue(this.editcell.row,g.displayfield),r=this.editcell.value;oldvalue={value:r,label:q}}else oldvalue=this.editcell.value;var s=this.getrowdata(b);if(g.cellendedit){var t=g.cellendedit(b,c,g.columntype,this.editcell.value,j);if(0==t)return this._raiseEvent(18,{rowindex:b,row:s,datafield:c,displayfield:g.displayfield,oldvalue:oldvalue,value:oldvalue,columntype:g.columntype}),k(this),!1}return this._raiseEvent(18,{rowindex:b,row:s,datafield:c,displayfield:g.displayfield,oldvalue:oldvalue,value:j,columntype:g.columntype}),this._hidecelleditor(!1),void 0!=this.editcell&&(this.editcell.editor=null,this.editcell.editing=!1),this.editcell=null,this.editchar=null,this.setcellvalue(b,c,j,e),this.enablebrowserselection||(this.host.addClass("jqx-disableselect"),this.content.addClass("jqx-disableselect")),a.jqx.browser.msie||i(),a.data(document.body,"jqxgrid.edit",""),!0}},beginrowedit:function(b){var c=this;c._oldselectedrow=b,this._cellscache=new Array;var d=!1;if("selectedrow"!=this.editmode&&(d=!0),d){var e=this.editmode;this.editmode="selectedrow"}var f=null;a.each(this.columns.records,function(a,d){if(c.editable&&this.editable){if("checkbox"===this.columntype||"custom"===this.columntype||"widget"===this.columntype||"template"===this.columntype||"button"===this.columntype)return!0;f||(f=this.datafield);var e=c.getcell(b,this.datafield);c.begincelledit(b,this.datafield,null,!1,!1);var g=c.getrowdata(b);c._raiseEvent(17,{rowindex:b,row:g,datafield:this.datafield,value:e.value,columntype:this.columntype})}}),c.editcell&&(c.editcell.init=!0),this._renderrows(this.virtualsizeinfo),d&&(this.editmode=e),f&&c.editcell&&setTimeout(function(){if(c.editcell){var a=c.editcell[f].editor;a&&(a.data().jqxWidget&&a.data().jqxWidget.focus?a.data().jqxWidget.focus():a.focus())}},25)},endrowedit:function(b,c){var d=this;if(this._currentEditableColumn=0,this._focusedColumn=null,this._currentColumn=null,this._checkboxCells=[],!this.editcell)return!1;if(void 0==this.editcell.editor&&"checkbox"!==this.editcell.columntype)return!1;var e=!1;if("selectedrow"!=this.editmode&&(e=!0),e){var f=this.editmode;this.editmode="selectedrow"}var g=!1,h={};this.validationpopup&&(this.validationpopup.hide(),this.validationpopuparrow.hide());for(var i=0;i<this.columns.records.length;i++){var j=this.columns.records[i];if(j.editable&&!j.hidden&&"checkbox"!=j.columntype&&!j.createwidget){var k=this._geteditorvalue(j),l=function(a){a._hidecelleditor();var c=a.getcellvalue(a.editcell.row,j.displayfield);if(j.cellendedit&&j.cellendedit(b,o,j.columntype,c,k),a.editchar=null,j.displayfield!=j.datafield){var d=a.getcellvalue(a.editcell.row,j.displayfield),e=c;m={value:e,label:d}}else m=c;var f=a.getrowdata(b);a._raiseEvent(18,{rowindex:b,row:f,datafield:o,displayfield:j.displayfield,oldvalue:c,value:c,columntype:j.columntype}),a.editcell.editing=!1};if(c)l(this);else{if(j.cellvaluechanging){var m=this.getcellvalue(this.editcell.row,j.displayfield),n=j.cellvaluechanging(b,o,j.columntype,m,k);void 0!=n&&(k=n)}var o=j.datafield;if(j.validation){var p=this.getcell(b,j.datafield);try{var q=j.validation(p,k),r=this.gridlocalization.validationstring;void 0!=q.message&&(r=q.message);var s="boolean"==typeof q?q:q.result;if(!s){void 0!=q.showmessage&&1!=q.showmessage||this._showvalidationpopup(b,o,r),g=!0,this.editcell[j.datafield].validated=!1;continue}}catch(a){this._showvalidationpopup(b,o,this.gridlocalization.validationstring),this.editcell[j.datafield].validated=!1,g=!0;continue}}if(j.displayfield!=j.datafield){var t=this.getcellvalue(this.editcell.row,j.displayfield),u=this.editcell.value;m={value:u,label:t}}else m=this.getcellvalue(this.editcell.row,j.displayfield);h[j.datafield]={newvalue:k,oldvalue:m}}}}var v={},w={};if(!g){this._hidecelleditor(!1);for(var i=0;i<this.columns.records.length;i++){var j=this.columns.records[i],o=j.datafield;if(!j.hidden&&j.editable){var x=this.getrowdata(b);if(!j.createwidget)if("checkbox"!=j.columntype){if(h[j.datafield]){var k=h[j.datafield].newvalue,m=h[j.datafield].oldvalue;if(j.cellendedit){var y=j.cellendedit(b,o,j.columntype,m,k);if(0==y){this._raiseEvent(18,{rowindex:b,row:x,datafield:o,displayfield:j.displayfield,oldvalue:m,value:m,columntype:j.columntype}),l(this);continue}}this.source.updaterow||this._raiseEvent(18,{rowindex:b,row:x,datafield:j.datafield,displayfield:j.displayfield,oldvalue:m,value:k,columntype:j.columntype}),v[j.datafield]=k,w[j.datafield]=m}}else{var k=this.getcellvalue(b,j.displayfield);this._raiseEvent(18,{rowindex:b,row:x,datafield:j.datafield,displayfield:j.displayfield,oldvalue:k,value:k,columntype:j.columntype})}}}var z=this.getrowid(b),x=this.getrowdata(b);if(a.each(v,function(a,b){if(b&&void 0!=b.label){var c=d.getcolumn(a);x[c.displayfield]=b.label,x[c.datafield]=b.value}else x[a]=b}),this.enablebrowserselection||(this.host.addClass("jqx-disableselect"),this.content.addClass("jqx-disableselect")),a.data(document.body,"jqxgrid.edit",""),this.editcell=null,this.editchar=null,this.source.updaterow&&!c){var A=!1,d=this,s=function(c){var e=d.source.updaterow;d.source.updaterow=null,0==c?(a.each(w,function(a,b){if(b&&void 0!=b.label){var c=d.getcolumn(a);x[c.displayfield]=b.label,x[c.datafield]=b.value}else x[a]=b}),d.updaterow(z,x)):d.updaterow(z,x);for(var f=0;f<d.columns.records.length;f++){var g=d.columns.records[f];g.datafield;d._raiseEvent(18,{rowindex:b,datafield:g.datafield,row:x,displayfield:g.displayfield,oldvalue:w[g.datafield],value:x[g.displayfield],columntype:g.columntype})}d.source.updaterow=e};try{A=this.source.updaterow(z,x,s),void 0==A&&(A=!0)}catch(a){return void(A=!1)}}else c||this.updaterow(z,x),this._renderrows(this.virtualsizeinfo)}return e&&(this.editmode=f),g},_selection:function(a){if("selectionStart"in a[0]){var b=a[0],c=b.selectionEnd-b.selectionStart;return{start:b.selectionStart,end:b.selectionEnd,length:c,text:b.value}}var d=document.selection.createRange();if(null==d)return{start:0,end:b.value.length,length:0};var e=a[0].createTextRange(),f=e.duplicate();e.moveToBookmark(d.getBookmark()),f.setEndPoint("EndToStart",e);var c=d.text.length;return{start:f.text.length,end:f.text.length+d.text.length,length:c,text:d.text}},_setSelection:function(a,b,c){if("selectionStart"in c[0])c[0].focus(),c[0].setSelectionRange(a,b);else{var d=c[0].createTextRange();d.collapse(!0),d.moveEnd("character",b),d.moveStart("character",a),d.select()}},findRecordIndex:function(a,b,c){var c=c;if(b)for(var d=c.length,e=0;e<d;e++){var f=c[e],g=f.label;if(a==g)return e}return-1},_destroyeditors:function(){var b=this;this.columns.records&&(a.each(this.columns.records,function(c,d){var e=a.trim(this.datafield).split(" ").join("");switch(this.columntype){case"dropdownlist":var f=b.editors["dropdownlist_"+e];f&&(f.jqxDropDownList("destroy"),b.editors["dropdownlist_"+e]=null);break;case"combobox":var g=b.editors["combobox_"+e];g&&(g.jqxComboBox("destroy"),b.editors["combobox_"+e]=null);break;case"datetimeinput":var h=b.editors["datetimeinput_"+this.datafield];h&&(h.jqxDateTimeInput("destroy"),b.editors["datetimeinput_"+e]=null);break;case"numberinput":var i=b.editors["numberinput_"+e];i&&(i.jqxNumberInput("destroy"),b.editors["numberinput_"+e]=null);break;case"custom":case"template":if(b.destroyeditor&&b.editors["templateeditor_"+e]&&(b.destroyeditor(b.editors["templateeditor_"+e]),b.editors["templateeditor_"+e]=null),b.destroyeditor)for(var j=b.getrows.length(),k=0;k<j;k++)b.editors["customeditor_"+e+"_"+k]&&(b.destroyeditor(b.editors["customeditor_"+e+"_"+k],k),b.editors["customeditor_"+e+"_"+k]=null);break;case"textbox":default:var l=b.editors["textboxeditor_"+e];l&&(b.removeHandler(l,"keydown"),b.editors["textbox_"+e]=null)}}),b.editors=new Array)},_showcelleditor:function(b,c,d,e,f){if(void 0!=d&&null!=this.editcell){if("checkbox"==c.columntype&&c.editable)return void("selectedrow"==this.editmode&&(this._checkboxCells||(this._checkboxCells=[]),this._checkboxCells[c.datafield]=d));void 0==f&&(f=!0),"selectedrow"==this.editmode&&(this.editchar="",f=!1);var g=c.datafield,h=a(d),i=this,j=this.editcell.editor,k=this.getcellvalue(b,g),l=this.getcelltext(b,g),m=this.hScrollInstance,n=m.value,o=parseInt(n);this.columns.records.indexOf(c);if(this.editcell.element=d,0==this.editcell.validated){var p="";this.validationpopup&&(p=this.validationpopup.text()),this._showvalidationpopup(b,g,p)}var q=function(a){i.hScrollInstance.isScrolling()||i.vScrollInstance.isScrolling()||f&&(i.isTouchDevice()||(a&&a.focus(),0!=i.gridcontent[0].scrollTop&&(i.scrolltop(Math.abs(i.gridcontent[0].scrollTop)),i.gridcontent[0].scrollTop=0),0!=i.gridcontent[0].scrollLeft&&(i.gridcontent[0].scrollLeft=0)))};switch(c.columntype){case"dropdownlist":if(this.host.jqxDropDownList){d.innerHTML="";var r=a.trim(c.datafield).split(" ").join(""),s=a.trim(c.displayfield).split(" ").join("");r.indexOf(".")!=-1&&(r=r.replace(".","")),s.indexOf(".")!=-1&&(s=s.replace(".",""));var t=this.editors["dropdownlist_"+r];if(j=void 0==t?a("<div style='border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='dropdownlisteditor'></div>"):t,j.css("top",a(d).parent().position().top),this.oldhscroll?j.css("left",-o+parseInt(a(d).position().left)):j.css("left",parseInt(a(d).position().left)),c.pinned&&j.css("left",o+parseInt(a(d).position().left)),void 0==t){j.prependTo(this.table),j[0].id="dropdownlisteditor"+this.element.id+r;var u=!!this.source._source,v=null;if(u){var w={localdata:this.source.records,datatype:this.source.datatype,async:!1};v=new a.jqx.dataAdapter(w,{autoBind:!1,async:!1,uniqueDataFields:[s],autoSort:!0,autoSortField:s})}else v=new a.jqx.dataAdapter(this.source,{autoBind:!1,uniqueDataFields:[s],async:!1,autoSort:!0,autoSortField:s});var x=!c.createeditor;j.jqxDropDownList({enableBrowserBoundsDetection:!0,keyboardSelection:!1,source:v,rtl:this.rtl,autoDropDownHeight:x,theme:this.theme,width:h.width()-2,height:h.height()-2,displayMember:s,valueMember:g}),this.editors["dropdownlist_"+r]=j,c.createeditor&&c.createeditor(b,k,j)}c._requirewidthupdate&&j.jqxDropDownList({width:h.width()-2});var y=j.jqxDropDownList("listBox").visibleItems;c.createeditor||(y.length<8?j.jqxDropDownList("autoDropDownHeight",!0):j.jqxDropDownList("autoDropDownHeight",!1));var k=this.getcellvalue(b,s),z=this.findRecordIndex(k,s,y);if(e&&(""!=k?j.jqxDropDownList("selectIndex",z,!0):j.jqxDropDownList("selectIndex",-1)),!this.editcell)return;void 0!=this.editcell.defaultvalue&&j.jqxDropDownList("selectIndex",this.editcell.defaultvalue,!0),f&&j.jqxDropDownList("focus")}break;case"combobox":if(this.host.jqxComboBox){d.innerHTML="";var r=a.trim(c.datafield).split(" ").join(""),s=a.trim(c.displayfield).split(" ").join("");r.indexOf(".")!=-1&&(r=r.replace(".","")),s.indexOf(".")!=-1&&(s=s.replace(".",""));var A=this.editors["combobox_"+r];if(j=void 0==A?a("<div style='border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='comboboxeditor'></div>"):A,j.css("top",a(d).parent().position().top),this.oldhscroll?j.css("left",-o+parseInt(a(d).position().left)):j.css("left",parseInt(a(d).position().left)),c.pinned&&j.css("left",o+parseInt(a(d).position().left)),void 0==A){j.prependTo(this.table),j[0].id="comboboxeditor"+this.element.id+r;var u=!!this.source._source,v=null;if(u){var w={localdata:this.source.records,datatype:this.source.datatype,async:!1};v=new a.jqx.dataAdapter(w,{autoBind:!1,async:!1,uniqueDataFields:[s],autoSort:!0,autoSortField:s})}else v=new a.jqx.dataAdapter(this.source,{autoBind:!1,uniqueDataFields:[s],async:!1,autoSort:!0,autoSortField:s});var x=!c.createeditor;j.jqxComboBox({enableBrowserBoundsDetection:!0,keyboardSelection:!1,source:v,rtl:this.rtl,autoDropDownHeight:x,theme:this.theme,width:h.width()-2,height:h.height()-2,displayMember:s,valueMember:g}),j.removeAttr("tabindex"),j.find("div").removeAttr("tabindex"),this.editors["combobox_"+r]=j,c.createeditor&&c.createeditor(b,k,j)}c._requirewidthupdate&&j.jqxComboBox({width:h.width()-2});var y=j.jqxComboBox("listBox").visibleItems;c.createeditor||(y.length<8?j.jqxComboBox("autoDropDownHeight",!0):j.jqxComboBox("autoDropDownHeight",!1));var k=this.getcellvalue(b,s),z=this.findRecordIndex(k,s,y);if(e&&(""!=k?(j.jqxComboBox("selectIndex",z,!0),j.jqxComboBox("val",k)):(j.jqxComboBox("selectIndex",-1),j.jqxComboBox("val",k))),!this.editcell)return;void 0!=this.editcell.defaultvalue&&j.jqxComboBox("selectIndex",this.editcell.defaultvalue,!0),this.editchar&&this.editchar.length>0&&j.jqxComboBox("input").val(this.editchar),f&&setTimeout(function(){if(q(j.jqxComboBox("input")),j)if(j.jqxComboBox("_setSelection",0,0),i.editchar)j.jqxComboBox("_setSelection",1,1),i.editchar=null;else if(j.jqxComboBox("input")){var a=j.jqxComboBox("input").val();j.jqxComboBox("_setSelection",0,a.length)}},10)}break;case"datetimeinput":if(this.host.jqxDateTimeInput){d.innerHTML="";var r=a.trim(c.datafield).split(" ").join("");r.indexOf(".")!=-1&&(r=r.replace(".",""));var B=this.editors["datetimeinput_"+r];if(j=void 0==B?a("<div style='border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='datetimeeditor'></div>"):B,j.show(),j.css("top",a(d).parent().position().top),this.oldhscroll?j.css("left",-o+parseInt(a(d).position().left)):j.css("left",parseInt(a(d).position().left)),c.pinned&&j.css("left",o+parseInt(a(d).position().left)),void 0==B){j.prependTo(this.table),j[0].id="datetimeeditor"+this.element.id+r;var C={calendar:this.gridlocalization};j.jqxDateTimeInput({firstDayOfWeek:this.gridlocalization.firstDay,enableBrowserBoundsDetection:!0,localization:C,_editor:!0,theme:this.theme,rtl:this.rtl,width:h.width(),height:h.height(),formatString:c.cellsformat}),this.editors["datetimeinput_"+r]=j,c.createeditor&&c.createeditor(b,k,j)}if(c._requirewidthupdate&&j.jqxDateTimeInput({width:h.width()-2}),e){if(""!=k&&null!=k){var D=new Date(k);"Invalid Date"==D&&this.source.getvaluebytype&&(D=this.source.getvaluebytype(k,{name:c.datafield,type:"date"})),j.jqxDateTimeInput("setDate",D)}else j.jqxDateTimeInput("setDate",null);void 0!=this.editcell.defaultvalue&&j.jqxDateTimeInput("setDate",this.editcell.defaultvalue)}if(f){var E=this.editEvent;setTimeout(function(){q(j.jqxDateTimeInput("dateTimeInput")),setTimeout(function(){if(j.jqxDateTimeInput("_selectGroup",0),i.editchar&&i.editchar.length>0){var a=parseInt(i.editchar);if(!isNaN(a)&&E){var b=E.charCode?E.charCode:E.keyCode?E.keyCode:0;j.jqxDateTimeInput("_handleKeyPress",E,b)}}},25)},10)}}break;case"numberinput":if(this.host.jqxNumberInput){d.innerHTML="";var r=a.trim(c.datafield).split(" ").join("");r.indexOf(".")!=-1&&(r=r.replace(".",""));var F=this.editors["numberinput_"+r];if(j=void 0==F?a("<div style='border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='numbereditor'></div>"):F,j.show(),j.css("top",a(d).parent().position().top),this.oldhscroll?j.css("left",-o+parseInt(a(d).position().left)):j.css("left",parseInt(a(d).position().left)),c.pinned&&j.css("left",o+parseInt(a(d).position().left)),void 0==F){j.prependTo(this.table),j[0].id="numbereditor"+this.element.id+r;var G="",H="left",I=2;c.cellsformat?c.cellsformat.indexOf("c")!=-1?(G=this.gridlocalization.currencysymbol,H=this.gridlocalization.currencysymbolposition,H="before"==H?"left":"right",c.cellsformat.length>1&&(I=parseInt(c.cellsformat.substring(1),10))):c.cellsformat.indexOf("p")!=-1&&(G=this.gridlocalization.percentsymbol,H="right",c.cellsformat.length>1&&(I=parseInt(c.cellsformat.substring(1),10))):I=0,j.jqxNumberInput({decimalSeparator:this.gridlocalization.decimalseparator,decimalDigits:I,inputMode:"simple",theme:this.theme,rtl:this.rtl,width:h.width()-1,height:h.height()-1,spinButtons:!0,symbol:G,symbolPosition:H}),this.editors["numberinput_"+r]=j,c.createeditor&&c.createeditor(b,k,j)}if(c._requirewidthupdate&&j.jqxNumberInput({width:h.width()-2}),e){if(""!=k&&null!=k){var J=k;j.jqxNumberInput("setDecimal",J)}else j.jqxNumberInput("setDecimal",0);if(void 0!=this.editcell.defaultvalue&&j.jqxNumberInput("setDecimal",this.editcell.defaultvalue),this.editchar&&this.editchar.length>0){var K=parseInt(this.editchar);isNaN(K)||j.jqxNumberInput("setDecimal",K)}f&&setTimeout(function(){
-if(q(j.jqxNumberInput("numberInput")),j.jqxNumberInput("_setSelectionStart",0),i.editchar)c.cellsformat.length>0?j.jqxNumberInput("_setSelectionStart",2):j.jqxNumberInput("_setSelectionStart",1),i.editchar=null;else{var a=j.jqxNumberInput("spinButtons");if(a){var b=j.jqxNumberInput("numberInput").val();i._setSelection(j.jqxNumberInput("numberInput")[0],b.length,b.length)}else{var b=j.jqxNumberInput("numberInput").val();i._setSelection(j.jqxNumberInput("numberInput")[0],0,b.length)}j.jqxNumberInput("selectAll")}},10)}}break;case"custom":d.innerHTML="";var r=a.trim(c.datafield).split(" ").join("");r.indexOf(".")!=-1&&(r=r.replace(".",""));var L=this.editors["customeditor_"+r+"_"+b];if(j=void 0==L?a("<div style='overflow: hidden; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='customeditor'></div>"):L,j.show(),j.css("top",a(d).parent().position().top),this.oldhscroll?j.css("left",-o+parseInt(a(d).position().left)):j.css("left",parseInt(a(d).position().left)),c.pinned&&j.css("left",o+parseInt(a(d).position().left)),void 0==L){j.prependTo(this.table),j[0].id="customeditor"+this.element.id+r+"_"+b,this.editors["customeditor_"+r+"_"+b]=j;var M=h.width()-1,N=h.height()-1;j.width(M),j.height(N),c.createeditor&&c.createeditor(b,k,j,l,M,N,this.editchar)}c._requirewidthupdate&&j.width(h.width()-2);break;case"template":d.innerHTML="";var r=a.trim(c.datafield).split(" ").join("");r.indexOf(".")!=-1&&(r=r.replace(".",""));var O=this.editors["templateeditor_"+r];if(j=void 0==O?a("<div style='overflow: hidden; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='templateeditor'></div>"):O,j.show(),j.css("top",a(d).parent().position().top),this.oldhscroll?j.css("left",-o+parseInt(a(d).position().left)):j.css("left",parseInt(a(d).position().left)),c.pinned&&j.css("left",o+parseInt(a(d).position().left)),void 0==O){j.prependTo(this.table),j[0].id="templateeditor"+this.element.id+r,this.editors["templateeditor_"+r]=j;var M=h.width()-1,N=h.height()-1;j.width(M),j.height(N),c.createeditor&&c.createeditor(b,k,j,l,M,N,this.editchar)}c._requirewidthupdate&&j.width(h.width()-2);break;case"textbox":default:d.innerHTML="",j=this.editors["textboxeditor_"+c.datafield]||a("<input autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' type='textbox' id='textboxeditor'/>"),j[0].id="textboxeditor"+this.element.id+c.datafield,j.appendTo(h),this.rtl&&j.css("direction","rtl"),(e||""==j[0].className)&&(j.addClass(this.toThemeProperty("jqx-input")),j.addClass(this.toThemeProperty("jqx-widget-content")),this.editchar&&this.editchar.length>0?j.val(this.editchar):(""!=c.cellsformat&&(k=this.getcelltext(b,g)),void 0==k&&(k=""),j.val(k)),void 0!=this.editcell.defaultvalue&&j.val(this.editcell.defaultvalue),j.width(h.width()+1),j.height(h.height()+1),c.createeditor&&c.createeditor(b,k,j),""!=c.cellsformat&&(c.cellsformat.indexOf("p")==-1&&c.cellsformat.indexOf("c")==-1&&c.cellsformat.indexOf("n")==-1&&c.cellsformat.indexOf("f")==-1||this.editors["textboxeditor_"+c.datafield]||j.keydown(function(a){var b=a.charCode?a.charCode:a.keyCode?a.keyCode:0,d=String.fromCharCode(b),e=parseInt(d);if(isNaN(e))return!0;if(i._selection(j).length>0)return!0;var f="",g=j.val();if(c.cellsformat.length>1){var h=parseInt(c.cellsformat.substring(1));isNaN(h)&&(h=0)}else var h=0;if(h>0&&g.indexOf(i.gridlocalization.decimalseparator)!=-1&&i._selection(j).start>g.indexOf(i.gridlocalization.decimalseparator))return!0;for(var k=0;k<g.length-h;k++){var l=g.substring(k,k+1);null!=l.match(/^[0-9]+$/)&&(f+=l)}return!(f.length>=11)&&void 0}))),this.editors["textboxeditor_"+c.datafield]=j,e&&f&&setTimeout(function(){q(j),i.editchar?(i._setSelection(j[0],1,1),i.editchar=null):i._setSelection(j[0],0,j.val().length)},25)}j&&(j[0].style.zIndex=1+parseInt(d.style.zIndex),a.jqx.browser.msie&&a.jqx.browser.version<8&&(j[0].style.zIndex=1+this.columns.records.length+d.style.zIndex),j.css("display","block"),this.editcell.editor=j,this.editcell[g]?this.editcell[g].editor=j:(this.editcell[g]={},this.editcell[g].editor=j)),e&&c.initeditor&&c.initeditor(b,k,j,l,this.editchar),i.isTouchDevice()||setTimeout(function(){i.content&&(i.content[0].scrollTop=0,i.content[0].scrollLeft=0),i.gridcontent&&(i.gridcontent[0].scrollLeft=0,i.gridcontent[0].scrollTop=0)},10)}},_setSelection:function(a,b,c){try{if("selectionStart"in a)a.setSelectionRange(b,c);else{var d=a.createTextRange();d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d.select()}}catch(a){}},_hideeditors:function(){if(null!=this.editcells){var a=this;for(var b in this.editcells)a.editcell=a.editcells[b],a._hidecelleditor()}},_hidecelleditor:function(a){if(this.editcell){if("selectedrow"===this.editmode){for(var b=0;b<this.columns.records.length;b++){var c=this.columns.records[b];if(this.editcell[c.datafield]&&this.editcell[c.datafield].editor){this.editcell[c.datafield].editor.hide();var d=this.editcell[c.datafield].editor;switch(c.columntype){case"dropdownlist":d.jqxDropDownList({closeDelay:0}),d.jqxDropDownList("hideListBox"),d.jqxDropDownList({closeDelay:300});break;case"combobox":d.jqxComboBox({closeDelay:0}),d.jqxComboBox("hideListBox"),d.jqxComboBox({closeDelay:300});break;case"datetimeinput":d.jqxDateTimeInput("isOpened")&&(d.jqxDateTimeInput({closeDelay:0}),d.jqxDateTimeInput("hideCalendar"),d.jqxDateTimeInput({closeDelay:300}))}}}return void(this.validationpopup&&(this.validationpopup.hide(),this.validationpopuparrow.hide()))}if("checkbox"!=this.editcell.columntype){if(this.editcell.editor)switch(this.editcell.editor.hide(),this.editcell.columntype){case"dropdownlist":this.editcell.editor.jqxDropDownList({closeDelay:0}),this.editcell.editor.jqxDropDownList("hideListBox"),this.editcell.editor.jqxDropDownList({closeDelay:300});break;case"combobox":this.editcell.editor.jqxComboBox({closeDelay:0}),this.editcell.editor.jqxComboBox("hideListBox"),this.editcell.editor.jqxComboBox({closeDelay:300});break;case"datetimeinput":var e=this.editcell.editor;e.jqxDateTimeInput("isOpened")&&(e.jqxDateTimeInput({closeDelay:0}),e.jqxDateTimeInput("hideCalendar"),e.jqxDateTimeInput({closeDelay:300}))}this.validationpopup&&(this.validationpopup.hide(),this.validationpopuparrow.hide()),this.isNestedGrid||0!=a&&this.element.focus()}}},_geteditorvalue:function(b){var c=new String;if(!this.editcell)return null;var d=this.editcell.editor;if("selectedrow"==this.editmode&&this.editcell[b.datafield])var d=this.editcell[b.datafield].editor;if(d){switch(b.columntype){case"textbox":default:if(c=d.val(),""!=b.cellsformat){var e="string",f=this.source.datafields||(this.source._source?this.source._source.datafields:null);if(f){var g="";a.each(f,function(){if(this.name==b.displayfield)return this.type&&(g=this.type),!1}),g&&(e=g)}var h="number"===e||"float"===e||"int"===e||"integer"===e,i="date"===e||"time"===e;if(h||"string"===e&&(b.cellsformat.indexOf("p")!=-1||b.cellsformat.indexOf("c")!=-1||b.cellsformat.indexOf("n")!=-1||b.cellsformat.indexOf("f")!=-1)){if(""===c&&b.nullable)return"";c.indexOf(this.gridlocalization.currencysymbol)>-1&&(c=c.replace(this.gridlocalization.currencysymbol,""));var j=function(a,b,c){var d=a;if(b==c)return a;for(var e=d.indexOf(b);e!=-1;)d=d.replace(b,c),e=d.indexOf(b);return d},k=c;if(k=new Number(k),!isNaN(k))return k;c=j(c,this.gridlocalization.thousandsseparator,""),c=c.replace(this.gridlocalization.decimalseparator,"."),c.indexOf(this.gridlocalization.percentsymbol)>-1&&(c=c.replace(this.gridlocalization.percentsymbol,""));for(var l="",m=0;m<c.length;m++){var n=c.substring(m,m+1);"-"===n&&(l+="-"),"."===n&&(l+="."),null!=n.match(/^[0-9]+$/)&&(l+=n)}c=l,c=c.replace(/ /g,""),c=new Number(c),isNaN(c)&&(c="")}if(i||"string"===e&&(b.cellsformat.indexOf("H")!=-1||b.cellsformat.indexOf("m")!=-1||b.cellsformat.indexOf("M")!=-1||b.cellsformat.indexOf("y")!=-1||b.cellsformat.indexOf("h")!=-1||b.cellsformat.indexOf("d")!=-1)){if(""===c&&b.nullable)return"";var o=c;a.jqx.dataFormat&&(c=a.jqx.dataFormat.tryparsedate(o,this.gridlocalization)),"Invalid Date"!=c&&null!=c||(c="")}}b.displayfield!=b.datafield&&(c={label:c,value:c});break;case"checkbox":d.jqxCheckBox&&(c=d.jqxCheckBox("checked"));break;case"datetimeinput":if(d.jqxDateTimeInput){if(d.jqxDateTimeInput({isEditing:!1}),d.jqxDateTimeInput("_validateValue"),c=d.jqxDateTimeInput("getDate"),null==c)return null;c=new Date(c.toString()),b.displayfield!=b.datafield&&(c={label:c,value:c})}break;case"dropdownlist":if(d.jqxDropDownList){var p=d.jqxDropDownList("selectedIndex"),q=d.jqxDropDownList("listBox").getVisibleItem(p);c=b.displayfield!=b.datafield?q?{label:q.label,value:q.value}:"":q?q.label:"",null==c&&(c="")}break;case"combobox":if(d.jqxComboBox){if(c=d.jqxComboBox("val"),b.displayfield!=b.datafield){var q=d.jqxComboBox("getSelectedItem");null!=q&&(c={label:q.label,value:q.value})}null==c&&(c="")}break;case"numberinput":if(d.jqxNumberInput){this.touchdevice&&d.jqxNumberInput("_doTouchHandling");var r=d.jqxNumberInput("getDecimal");c=new Number(r),c=parseFloat(c),isNaN(c)&&(c=0),null===r&&(c=null),b.displayfield!=b.datafield&&(c={label:c,value:c})}}b.geteditorvalue&&(c="selectedrow"==this.editmode?b.geteditorvalue(this.editcell.row,this.getcellvalue(this.editcell.row,b.datafield),d):b.geteditorvalue(this.editcell.row,this.editcell.value,d))}return c},hidevalidationpopups:function(){this.popups&&(a.each(this.popups,function(){this.validation.remove(),this.validationrow.remove()}),this.popups=new Array),this.validationpopup&&(this.validationpopuparrow.hide(),this.validationpopup.hide())},showvalidationpopup:function(b,c,d){if(void 0==d)var d=this.gridlocalization.validationstring;var e=a("<div style='z-index: 99999; top: 0px; left: 0px; position: absolute;'></div>"),f=a("<div style='width: 20px; height: 20px; z-index: 999999; top: 0px; left: 0px; position: absolute;'></div>");e.html(d),f.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up")),e.addClass(this.toThemeProperty("jqx-grid-validation")),e.addClass(this.toThemeProperty("jqx-rc-all")),e.prependTo(this.table),f.prependTo(this.table);for(var g=this.hScrollInstance,h=g.value,i=parseInt(h),j=this.getcolumn(c).uielement,k=null,l=0;l<this.hittestinfo.length;l++)b===this.hittestinfo[l].row.visibleindex&&(k=this.hittestinfo[l]);if(!k){this.ensurerowvisible(b);var m=this;return e.remove(),f.remove(),void setTimeout(function(){for(var a=null,e=0;e<m.hittestinfo.length;e++)b===m.hittestinfo[e].row.visibleindex&&(a=m.hittestinfo[e]);a&&m.showvalidationpopup(b,c,d)},25)}var n=a(k.visualrow);e.css("top",parseInt(n.position().top)+30+"px");var o=parseInt(e.css("top"));f.css("top",o-12),f.removeClass(),f.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));var p=!1;o>=this._gettableheight()&&(f.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-up")),f.addClass(this.toThemeProperty("jqx-grid-validation-arrow-down")),o=parseInt(n.position().top)-this.rowsheight-5,o<0&&(o=0,this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-down")),p=!0),e.css("top",o+"px"),f.css("top",o+e.outerHeight()-9));var q=-i+parseInt(a(j).position().left);f.css("left",i+q+30);var r=e.width();if(r+q>this.host.width()-20){var s=r+q-this.host.width()+40;q-=s}p?e.css("left",i+parseInt(a(j).position().left)-e.outerWidth()):e.css("left",i+q),e.show(),f.show(),this.popups||(this.popups=new Array),this.popups[this.popups.length]={validation:e,validationrow:f}},_showvalidationpopup:function(b,c,d){var e=this.editcell,f=this.editcell.editor;if("selectedrow"==this.editmode){var e=this.editcell[c];e&&e.editor&&(f=e.editor,e.element=f)}if(f&&!(this.validationpopup&&a.jqx.isHidden(this.validationpopup)&&(this.validationpopup.remove&&(this.validationpopup.remove(),this.validationpopuparrow.remove()),this.validationpopup=null,this.validationpopuparrow=null,void 0===c&&void 0===d&&this.editors&&0===this.editors.length))){if(this.validationpopup)this.validationpopup.html(d);else{var g=a("<div style='z-index: 99999; top: 0px; left: 0px; position: absolute;'></div>"),h=a("<div style='width: 20px; height: 20px; z-index: 999999; top: 0px; left: 0px; position: absolute;'></div>");g.html(d),h.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up")),g.addClass(this.toThemeProperty("jqx-grid-validation")),g.addClass(this.toThemeProperty("jqx-rc-all")),g.prependTo(this.table),h.prependTo(this.table),this.validationpopup=g,this.validationpopuparrow=h}var i=this.hScrollInstance,j=i.value,k=parseInt(j);"selectedrow"==this.editmode?this.visiblerows&&this.visiblerows[this.editcell.visiblerowindex]?this.validationpopup.css("top",this.visiblerows[this.editcell.visiblerowindex].top+(this.rowsheight+5)+"px"):this.validationpopup.css("top",parseInt(a(e.editor).position().top)+(this.rowsheight+5)+"px"):this.validationpopup.css("top",parseInt(a(e.element).parent().position().top)+(this.rowsheight+5)+"px");var l=parseInt(this.validationpopup.css("top"));this.validationpopuparrow.css("top",l-11),this.validationpopuparrow.removeClass(),this.validationpopuparrow.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));var m=this._gettableheight(),n=!1;l>=m&&(this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-up")),this.validationpopuparrow.addClass(this.toThemeProperty("jqx-grid-validation-arrow-down")),l=parseInt(a(e.element).parent().position().top)-this.rowsheight-5,"selectedrow"==this.editmode&&(l=this.visiblerows&&this.visiblerows[this.editcell.visiblerowindex]?this.visiblerows[this.editcell.visiblerowindex].top-this.rowsheight-5:parseInt(a(e.editor).position().top)-this.rowsheight-5),l<0&&(l=0,this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-down")),n=!0),this.validationpopup.css("top",l+"px"),this.validationpopuparrow.css("top",l+this.validationpopup.outerHeight()-9));var o=-k+parseInt(a(e.element).position().left);this.validationpopuparrow.css("left",k+o+30);var p=this.validationpopup.width();if(p+o>this.host.width()-20){var q=p+o-this.host.width()+40;o-=q}n?this.validationpopup.css("left",k+parseInt(a(e.element).position().left)-this.validationpopup.outerWidth()):this.validationpopup.css("left",k+o),"none"==this.editcell.editor.css("display")?(this.validationpopup.hide(),this.validationpopuparrow.hide()):(this.validationpopup.show(),this.validationpopuparrow.show())}}})}(jqxBaseFramework);
-
+jQWidgets v12.0.1 (2021-Mar)
+Copyright (c) 2011-2021 jQWidgets.
+License: https://jqwidgets.com/license/
+*/
+/* eslint-disable */
+
+(function(a){a.extend(a.jqx._jqxGrid.prototype,{_handledblclick:function(t,n){if(t.target==null){return}if(n.disabled){return}if(a(t.target).ischildof(this.columnsheader)){return}var w;if(t.which){w=(t.which==3)}else{if(t.button){w=(t.button==2)}}if(w){return}var C;if(t.which){C=(t.which==2)}else{if(t.button){C=(t.button==1)}}if(C){return}var v=this.showheader?this.columnsheader.height()+2:0;var o=this._groupsheader()?this.groupsheader.height():0;var B=this.showtoolbar?this.toolbarheight:0;var z=this.showfilterbar?this.toolbarheight:0;o+=B;o+=z;var e=this.host.offset();var m=t.pageX-e.left;var l=t.pageY-v-e.top-o;var b=this._hittestrow(m,l);if(!b){return}var h=b.row;var j=b.index;var q=t.target.className;var p=this.table[0].rows[j];if(p==null){return}n.mousecaptured=true;n.mousecaptureposition={left:t.pageX,top:t.pageY-o};var r=this.hScrollInstance;var s=r.value;var d=0;var k=this.groupable?this.groups.length:0;for(var u=0;u<p.cells.length;u++){var f=parseInt(a(this.columnsrow[0].cells[u]).css("left"));var g=f-s;if(n.columns.records[u].pinned){g=f}var c=this._getcolumnat(u);if(c!=null&&c.hidden){continue}var A=g+a(this.columnsrow[0].cells[u]).width();if(A>=m&&m>=g){d=u;break}}if(h!=null){var c=this._getcolumnat(d);if(!(q.indexOf("jqx-grid-group-expand")!=-1||q.indexOf("jqx-grid-group-collapse")!=-1)){if(h.boundindex!=-1){n.begincelledit(n.getboundindex(h),c.datafield,c.defaulteditorvalue)}}}},_getpreveditablecolumn:function(c){var b=this;while(c>0){c--;var d=b.getcolumnat(c);if(!d){return null}if(!d.editable){continue}if(!d.hidden){return d}}return null},_getnexteditablecolumn:function(c){var b=this;while(c<this.columns.records.length){c++;var d=b.getcolumnat(c);if(!d){return null}if(!d.editable){continue}if(!d.hidden){return d}}return null},_handleeditkeydown:function(T,j){if(j.handlekeyboardnavigation){var L=j.handlekeyboardnavigation(T);if(L==true){return true}}var u=T.charCode?T.charCode:T.keyCode?T.keyCode:0;j.editEvent=T;if(j.showfilterrow&&j.filterable){if(this.filterrow){if(a(T.target).ischildof(this.filterrow)){return true}}}if(T.target.className&&T.target.className.indexOf("jqx-grid-widget")>=0){return true}if(j.pageable){if(a(T.target).ischildof(this.pager)){return true}}if(this.showtoolbar){if(a(T.target).ischildof(this.toolbar)){return true}}if(this.showeverpresentrow){if(this.addnewrowtop){if(a(T.target).ischildof(this.addnewrowtop)){return true}}if(this.addnewrowbottom){if(a(T.target).ischildof(this.addnewrowbottom)){return true}}}if(this.showstatusbar){if(a(T.target).ischildof(this.statusbar)){return true}}if(this.rowdetails){if(a(T.target).ischildof(this.content.find("[role='rowgroup']"))){return true}}if(this.editcell){if(this.editmode==="selectedrow"){if(u===13){this.endrowedit(this.editcell.row,false);return false}else{if(u===27){this.endrowedit(this.editcell.row,true);return false}}if(u==32){if(this._currentColumn&&this.getcolumn(this._currentColumn).columntype=="checkbox"){var M=this.getcolumn(this._currentColumn);if(M.editable){var A=!this.getcellvalue(this.editcell.row,M.datafield);var H=this.getrowdata(this.editcell.row);var s=this.editcell.row;var H=j.getrowdata(j.editcell.row);this.pushToHistory=true;this.setcellvalue(this.editcell.row,M.datafield,A,false);this.pushToHistory=false;var k=this._focusedColumn;var d=this._currentColumn;var f=this._currentEditableColumn;this.endrowedit(this.editcell.row,false);this.beginrowedit(s,false);this._currentColumn=d;this._focusedColumn=k;this._currentEditableColumn=f;this._renderrows();this.selectcell(s,M.datafield);this._oldselectedcell=this.selectedcell;if(k){var G=this;setTimeout(function(){G.selectcell(s,M.datafield);G._oldselectedcell=G.selectedcell;a(G._checkboxCells[M.datafield].checkbox).jqxCheckBox("focus")},25)}return false}}}if(u===9){var K=this.editcell.datafield;var e=this._getcolumnindex(K);if(this._currentEditableColumn){e=this._currentEditableColumn}else{this._currentEditableColumn=e}var M=this._getnexteditablecolumn(e);if(T.shiftKey||this.rtl){M=this._getpreveditablecolumn(e)}if(M){var e=this._getcolumnindex(M.datafield);if(this.editcell[M.datafield]){this._currentEditableColumn=e;var b=this.editcell[M.datafield].editor;if(b){if(b.data().jqxWidget&&b.data().jqxWidget.focus){b.data().jqxWidget.focus()}else{b.focus();b[0].onkeyup=function(){if(j.gridcontent[0].scrollTop!=0){j.scrolltop(Math.abs(j.gridcontent[0].scrollTop));j.gridcontent[0].scrollTop=0}if(j.gridcontent[0].scrollLeft!=0){j.gridcontent[0].scrollLeft=0}}}}this._focusedColumn=M.datafield;this._currentColumn=M.datafield;if(this.gridcontent[0].scrollTop!=0){this.scrolltop(Math.abs(this.gridcontent[0].scrollTop));this.gridcontent[0].scrollTop=0}if(this.gridcontent[0].scrollLeft!=0){this.gridcontent[0].scrollLeft=0}}else{if(M.columntype=="checkbox"){this._currentColumn=M.datafield;this._currentEditableColumn=e;this.selectcell(this.editcell.row,M.datafield);this._oldselectedcell=this.selectedcell;if(this._checkboxCells[M.datafield]){a(this._checkboxCells[M.datafield].checkbox).jqxCheckBox("focus")}return false}}}return false}return true}if(this.editcell.columntype==null||this.editcell.columntype=="textbox"||this.editcell.columntype=="numberinput"||this.editcell.columntype=="combobox"||this.editcell.columntype=="datetimeinput"){if(u>=33&&u<=40&&j.selectionmode=="multiplecellsadvanced"){var b=this.editcell.columntype=="textbox"||this.editcell.columntype==null?this.editcell.editor:this.editcell.editor.find("input");var p=j._selection(b);var J=b.val().length;if(p.length>0&&this.editcell.columntype!="datetimeinput"){j._cancelkeydown=true}if(p.start>0&&u==37){j._cancelkeydown=true}if(p.start<J&&u==39&&this.editcell.columntype!="datetimeinput"){j._cancelkeydown=true}if(this.editcell.columntype=="datetimeinput"&&u==39){if(p.start+p.length<J){j._cancelkeydown=true}}}}else{if(this.editcell.columntype=="dropdownlist"){if(u==37||u==39&&j.selectionmode=="multiplecellsadvanced"){j._cancelkeydown=false}}else{if(this.selectionmode=="multiplecellsadvanced"&&this.editcell.columntype!="textbox"&&this.editcell.columntype!="numberinput"){j._cancelkeydown=true}}}if(u==32){if(j.editcell.columntype=="checkbox"){var M=j.getcolumn(j.editcell.datafield);if(M.editable){var A=!j.getcellvalue(j.editcell.row,j.editcell.column);if(M.cellbeginedit){var n=M.cellbeginedit(j.editcell.row,M.datafield,M.columntype,!A);if(n==false){return false}}var H=j.getrowdata(j.editcell.row);j.pushToHistory=true;j.setcellvalue(j.editcell.row,j.editcell.column,A,true);j.pushToHistory=false;j._raiseEvent(18,{rowindex:j.editcell.row,row:H,datafield:j.editcell.column,oldvalue:!A,value:A,columntype:"checkbox"});return false}}}if(u==9){var l=this.editcell.row;var K=this.editcell.column;var i=K;var e=j._getcolumnindex(K);var D=false;var I=j.getrowvisibleindex(l);var N=l;this.editchar="";var t=this.editcell.validated;if(!this.editcell.validated){var t=this.endcelledit(this.editcell.row,this.editcell.column,false,true,false)}if(t!=false){if(T.shiftKey||this.rtl){var M=j._getpreveditablecolumn(e);if(M){K=M.datafield;D=true;if(j.selectionmode.indexOf("cell")!=-1){j.selectprevcell(l,i);j._oldselectedcell=j.selectedcell;setTimeout(function(){j.ensurecellvisible(I,K)},10)}}else{var r=j._getlastvisiblecolumn();D=true;K=r.displayfield;var h=j.getdisplayrows()[I-1];if(h){l=h.dataindex;if(l===undefined){l=h.boundindex}I=j.getrowvisibleindex(l)}var y=true;if(j.pageable){var Q=Math.floor(I/this.pagesize);if(this.dataview.pagenum!=Q){y=false}}if(y&&j.selectionmode.indexOf("cell")!=-1){j.clearselection();j.selectcell(l,K);j._oldselectedcell=j.selectedcell;setTimeout(function(){j.ensurecellvisible(I,K)},10)}}}else{var M=j._getnexteditablecolumn(e);if(M){K=M.datafield;D=true;if(j.selectionmode.indexOf("cell")!=-1){j.selectnextcell(l,i);j._oldselectedcell=j.selectedcell;setTimeout(function(){j.ensurecellvisible(I,K)},10)}}else{var x=j._getfirstvisiblecolumn();D=true;K=x.displayfield;var h=j.getdisplayrows()[I+1];if(h){l=h.dataindex;if(l===undefined){l=h.boundindex}I=j.getrowvisibleindex(l)}var y=true;if(j.pageable){var Q=Math.floor(I/this.pagesize);if(this.dataview.pagenum!=Q){y=false}}if(j.selectionmode.indexOf("cell")!=-1){if(y){j.clearselection();j.selectcell(l,K);j._oldselectedcell=j.selectedcell;setTimeout(function(){j.ensurecellvisible(I,K)},10)}}}}if(D){if(j.pageable){var Q=Math.floor(I/this.pagesize);if(this.dataview.pagenum!=Q){this._renderrows(this.virtualsizeinfo);if(j.selectionmode.indexOf("cell")!=-1){j.clearselection();j.selectcell(N,i);j._oldselectedcell=j.selectedcell}if(Q>this.dataview.pagenum){setTimeout(function(){j.pagerpageinput.focus()},25)}return}}j.begincelledit(l,K);if(this.editcell!=null&&this.editcell.columntype=="checkbox"){this._renderrows(this.virtualsizeinfo)}}else{if(this.editcell!=null){j.endcelledit(l,K,false);this._renderrows(this.virtualsizeinfo)}return true}}return false}else{if(u==13){var F=this.selectedcell;if(F){var z=this.getrowvisibleindex(F.rowindex)}this.endcelledit(this.editcell.row,this.editcell.column,false,true);if(this.selectionmode=="multiplecellsadvanced"){var B=j.getselectedcell();if(B!=null){if(j.selectcell){if(this.editcell==null){if(B.rowindex+1<this.dataview.totalrecords){if(this.sortcolumn!=B.datafield){var I=this.getrowvisibleindex(B.rowindex);var q=this.dataview.loadedrecords[I+1];if(q){if(!this.pageable||(this.pageable&&I+1<(this.dataview.pagenum+1)*this.pagesize)){this.clearselection(false);this.selectcell(this.getboundindex(q),B.datafield);var B=this.getselectedcell();this.ensurecellvisible(q.visibleindex,B.datafield)}}}else{if(F!=null){var S=this.dataview.loadedrecords[z+1];if(S){if(!this.pageable||(this.pageable&&z+1<this.pagesize)){this.clearselection(false);this.selectcell(this.getboundindex(S),B.datafield)}else{if(this.pageable&&z+1>=this.pagesize){this.clearselection(false);var S=this.dataview.loadedrecords[z];this.selectcell(this.getboundindex(S),B.datafield)}}}}}}}}}}return false}else{if(u==27){this.endcelledit(this.editcell.row,this.editcell.column,true,true);return false}}}}else{var O=false;if(u==113){O=true}if(!T.ctrlKey&&!T.altKey&&!T.metaKey){if(u>=48&&u<=57){this.editchar=String.fromCharCode(u);O=true}if(u===189){O=true}if(u>=65&&u<=90){this.editchar=String.fromCharCode(u);var o=false;if(T.shiftKey){o=T.shiftKey}else{if(T.modifiers){o=!!(T.modifiers&4)}}if(this._capsLock){o=!o}if(!o){this.editchar=this.editchar.toLowerCase()}O=true}else{if(u>=96&&u<=105){this.editchar=u-96;this.editchar=this.editchar.toString();O=true}}var C=a(".jqx-grid").length;O=O&&(C==1||(C>1&&j.focused));var R=a.data(document.body,"jqxgrid.edit");if(R!==undefined&&R!==""){if(u===13||O){if(R!=j.element.id){return true}}}}if(u==13||O){if(j.getselectedrowindex){var l=j.getselectedrowindex();if(j.editmode==="selectedrow"){if(l>=0){j.beginrowedit(l)}else{var B=j.getselectedcell();if(B!=null){var M=j._getcolumnbydatafield(B.datafield);j.beginrowedit(B.rowindex)}return false}}switch(j.selectionmode){case"singlerow":case"multiplerows":case"multiplerowsextended":if(l>=0){var K="";for(var P=0;P<j.columns.records.length;P++){var M=j.getcolumnat(P);if(M.editable){K=M.datafield;break}}if(j.editmode==="selectedrow"){j.beginrowedit(l)}else{j.begincelledit(l,K)}}break;case"singlecell":case"multiplecells":case"multiplecellsextended":var B=j.getselectedcell();if(B!=null){var M=j._getcolumnbydatafield(B.datafield);if(j.editmode==="selectedrow"){j.beginrowedit(B.rowindex)}else{if(M.columntype!="checkbox"){j.begincelledit(B.rowindex,B.datafield)}}}break;case"multiplecellsadvanced":var B=j.getselectedcell();if(B!=null){if(u==13){if(j.selectcell){var I=this.getrowvisibleindex(B.rowindex);if(I+1<j.dataview.totalrecords){var q=this.dataview.loadedrecords[I+1];if(q){this.clearselection(false);this.selectcell(this.getboundindex(q),B.datafield);var B=this.getselectedcell();this.ensurecellvisible(q.visibleindex,B.datafield)}}}}else{if(j.editmode!=="selectedrow"){j.begincelledit(B.rowindex,B.datafield,null,false)}}}break}return false}}if(u==46){var v=j.getselectedcells();if(j.selectionmode.indexOf("cell")==-1){if(j._getcellsforcopypaste){v=j._getcellsforcopypaste()}}if(v!=null&&v.length>0){for(var w=0;w<v.length;w++){var B=v[w];if(!B.datafield){continue}var M=j.getcolumn(B.datafield);var E=j.getcellvalue(B.rowindex,B.datafield);if(E!==""&&M.editable&&j.enablekeyboarddelete){var c=null;if(M.columntype=="checkbox"){if(!M.threestatecheckbox){c=false}}if(M.cellbeginedit){var n=M.cellbeginedit(B.rowindex,M.datafield,M.columntype,c);if(n==false){return false}}var H=j.getrowdata(B.rowindex);j._raiseEvent(17,{rowindex:B.rowindex,row:H,datafield:B.datafield,value:E});j.pushToHistory=true;if(w==v.length-1){j.setcellvalue(B.rowindex,B.datafield,c,true);if(M.displayfield!=M.datafield){j.setcellvalue(B.rowindex,M.displayfield,c,true)}}else{j.setcellvalue(B.rowindex,B.datafield,c,false);if(M.displayfield!=M.datafield){j.setcellvalue(B.rowindex,M.displayfield,c,true)}}j.pushToHistory=false;if(M.cellendedit){var g=M.cellendedit(B.rowindex,M.datafield,M.columntype,c)}j._raiseEvent(18,{rowindex:B.rowindex,row:H,datafield:B.datafield,oldvalue:E,value:c})}}this.dataview.updateview();this._renderrows(this.virtualsizeinfo);return false}}if(u==32){var B=j.getselectedcell();if(B!=null){var M=j.getcolumn(B.datafield);if(M.columntype=="checkbox"&&M.editable){var A=!j.getcellvalue(B.rowindex,B.datafield);if(M.cellbeginedit){var n=M.cellbeginedit(B.rowindex,M.datafield,M.columntype,!A);if(n==false){return false}}var H=j.getrowdata(B.rowindex);j._raiseEvent(17,{rowindex:B.rowindex,row:H,datafield:B.datafield,value:!A,columntype:"checkbox"});j.pushToHistory=true;j.setcellvalue(B.rowindex,B.datafield,A,true);j.pushToHistory=false;j._raiseEvent(18,{rowindex:B.rowindex,row:H,datafield:B.datafield,oldvalue:!A,value:A,columntype:"checkbox"});return false}}}}return true},begincelledit:function(o,e,l,g,c){var f=this.getcolumn(e);this._cellscache=new Array();if(e==null){return}if(f.columntype=="number"||f.columntype=="button"||f.createwidget){return}if(this.groupable){if(this.groups.indexOf(e)>=0){return}if(this.groups.indexOf(f.displayfield)>=0){return}}if(this.editrow!=undefined){return}if(this.editcell){if(this.editcell.row==o&&this.editcell.column==e){return true}if(this.editmode==="selectedrow"){if(this.editcell.row==o){return}}var d=this.endcelledit(this.editcell.row,this.editcell.column,false,true,false);if(false==d){return}}var i=f.columntype=="checkbox"||f.columntype=="button"||f.createwidget;this.host.removeClass("jqx-disableselect");this.content.removeClass("jqx-disableselect");if(f.editable){if(f.cellbeginedit){var k=this.getcell(o,e);var m=f.cellbeginedit(o,e,f.columntype,k!=null?k.value:null);if(m==false){return}}var j=this.getrowvisibleindex(o);this.editcell=this.getcell(o,e);if(this.editcell){this.editcell.visiblerowindex=j;if(!this.editcell.editing){if(!i){this.editcell.editing=true}this.editcell.columntype=f.columntype;this.editcell.defaultvalue=l;if(f.defaultvalue!=undefined){this.editcell.defaultvalue=f.defaultvalue}this.editcell.init=true;if(f.columntype!="checkbox"&&this.editmode!="selectedrow"){var h=this.getrowdata(o);this._raiseEvent(17,{rowindex:o,row:h,datafield:f.datafield,value:this.editcell.value,columntype:f.columntype})}a.data(document.body,"jqxgrid.edit",this.element.id);if(!i){var b=this.getrowvisibleindex(o);if(g!==false){if(!this.autorowheight&&this.groups.length===0){var n=this.ensurecellvisible(b,f.datafield)}}if(c!==false){this._renderrows(this.virtualsizeinfo)}}if(this.editcell){this.editcell.init=false;return true}}}}else{if(!this.editcell){this.editchar="";return}this.editchar="";this.editcell.editor=null;this.editcell.editing=false;if(c!==false){this._renderrows(this.virtualsizeinfo)}this.editcell=null}},getScrollTop:function(){if(this._py){return this._py}this._py=typeof pageYOffset!="undefined";if(this._py){return pageYOffset}else{var c=document.body;var b=document.documentElement;b=(b.clientHeight)?b:c;return b.scrollTop}},getScrollLeft:function(){if(typeof pageXOffset!="undefined"){return pageXOffset}else{var c=document.body;var b=document.documentElement;b=(b.clientHeight)?b:c;return b.scrollLeft}},endcelledit:function(h,o,k,e,p){if(h==undefined||o==undefined){if(this.editcell){h=this.editcell.row;o=this.editcell.column}if(k==undefined){k=true}}if(!this.editcell){return}var d=this.getcolumn(o);var v=this;if(v.editmode==="selectedrow"){this.endrowedit(h,k);return}var u=function(){if(p!=false){if(v.isTouchDevice()){return}if(!v.isNestedGrid){var w=v.getScrollTop();var y=v.getScrollLeft();try{v.element.focus();v.content.focus();if(w!=v.getScrollTop()){window.scrollTo(y,w)}setTimeout(function(){v.element.focus();v.content.focus();if(w!=v.getScrollTop()){window.scrollTo(y,w)}},10)}catch(x){}}}};if(d.columntype=="checkbox"||d.columntype=="button"||d.createwidget){if(this.editcell){this.editcell.editor=null;this.editcell.editing=false;this.editcell=null}return true}var i=this._geteditorvalue(d);var g=function(x){x._hidecelleditor();if(d.cellendedit){d.cellendedit(h,o,d.columntype,x.editcell.value,i)}x.editchar=null;var z;if(d.displayfield!=d.datafield){var w=x.getcellvalue(x.editcell.row,d.displayfield);var y=x.editcell.value;z={value:y,label:w}}else{z=x.editcell.value}var A=x.getrowdata(h);x._raiseEvent(18,{rowindex:h,row:A,datafield:o,displayfield:d.displayfield,oldvalue:i,value:i,columntype:d.columntype});x.editcell.editor=null;x.editcell.editing=false;x.editcell=null;if(e||e==undefined){x._renderrows(x.virtualsizeinfo)}u();if(!x.enablebrowserselection){x.host.addClass("jqx-disableselect");x.content.addClass("jqx-disableselect")}};if(k){g(this);return false}if(this.validationpopup){this.validationpopup.hide();this.validationpopuparrow.hide()}if(d.cellvaluechanging){var b=d.cellvaluechanging(h,o,d.columntype,this.editcell.value,i);if(b!=undefined){i=b}}if(d.validation){var c=this.getcell(h,o);try{var q=d.validation(c,i);var m=this.gridlocalization.validationstring;if(q.message!=undefined){m=q.message}var n=typeof q=="boolean"?q:q.result;if(!n){if(q.showmessage==undefined||q.showmessage==true){this._showvalidationpopup(h,o,m)}this.editcell.validated=false;return false}}catch(s){this._showvalidationpopup(h,o,this.gridlocalization.validationstring);this.editcell.validated=false;return false}}var j;if(d.displayfield!=d.datafield){var l=this.getcellvalue(this.editcell.row,d.displayfield);var r=this.editcell.value;j={value:r,label:l}}else{j=this.editcell.value}var f=this.getrowdata(h);if(d.cellendedit){var t=d.cellendedit(h,o,d.columntype,this.editcell.value,i);if(t==false){this._raiseEvent(18,{rowindex:h,row:f,datafield:o,displayfield:d.displayfield,oldvalue:j,value:j,columntype:d.columntype});g(this);return false}}this._raiseEvent(18,{rowindex:h,row:f,datafield:o,displayfield:d.displayfield,oldvalue:j,value:i,columntype:d.columntype});this._hidecelleditor(false);if(this.editcell!=undefined){this.editcell.editor=null;this.editcell.editing=false}this.editcell=null;this.editchar=null;this.pushToHistory=true;this.setcellvalue(h,o,i,e);this.pushToHistory=false;if(!this.enablebrowserselection){this.host.addClass("jqx-disableselect");this.content.addClass("jqx-disableselect")}if(!a.jqx.browser.msie){u()}a.data(document.body,"jqxgrid.edit","");return true},beginrowedit:function(f){var e=this;var g=-1;if(f==undefined){return}e._oldselectedrow=f;this._cellscache=new Array();var c=false;if(this.editmode!="selectedrow"){c=true}if(c){var b=this.editmode;this.editmode="selectedrow"}var d=null;if(this._currentEditableColumn){d=this.getcolumnat(this._currentEditableColumn).datafield}a.each(this.columns.records,function(i,k){if(e.editable&&this.editable){if(this.columntype==="checkbox"||this.columntype==="custom"||this.columntype==="widget"||this.columntype==="template"||this.columntype==="button"){return true}if(!d){d=this.datafield}var h=e.getcell(f,this.datafield);e.begincelledit(f,this.datafield,null,false,false);var j=e.getrowdata(f);e._raiseEvent(17,{rowindex:f,row:j,datafield:this.datafield,value:h.value,columntype:this.columntype})}});if(e.editcell){e.editcell.init=true}this._renderrows(this.virtualsizeinfo);if(c){this.editmode=b}if(d&&e.editcell){setTimeout(function(){if(e.editcell&&e.editcell[d]){var h=e.editcell[d].editor;if(h){if(h.data().jqxWidget&&h.data().jqxWidget.focus){h.data().jqxWidget.focus()}else{h.focus()}}}},25)}},endrowedit:function(k,o){var D=this;this._currentEditableColumn=0;this._focusedColumn=null;this._currentColumn=null;this._checkboxCells=[];if(!this.editcell){return false}if(this.editcell.editor==undefined&&this.editcell.columntype!=="checkbox"){return false}var C=function(){if(focus!=false){if(D.isTouchDevice()){return}if(!D.isNestedGrid){var i=D.getScrollTop();var F=D.getScrollLeft();try{D.element.focus();D.content.focus();if(i!=D.getScrollTop()){window.scrollTo(F,i)}setTimeout(function(){D.element.focus();D.content.focus();if(i!=D.getScrollTop()){window.scrollTo(F,i)}},10)}catch(E){}}}};var p=false;if(this.editmode!="selectedrow"){p=true}if(p){var v=this.editmode;this.editmode="selectedrow"}var h=false;var d={};if(this.validationpopup){this.validationpopup.hide();this.validationpopuparrow.hide()}for(var B=0;B<this.columns.records.length;B++){var e=this.columns.records[B];if(!e.editable){continue}if(e.hidden){continue}if(e.columntype=="checkbox"){continue}if(e.createwidget){continue}var l=this._geteditorvalue(e);var g=function(F){F._hidecelleditor();var E=F.getcellvalue(F.editcell.row,e.displayfield);if(e.cellendedit){e.cellendedit(k,u,e.columntype,E,l)}F.editchar=null;var I;if(e.displayfield!=e.datafield){var i=F.getcellvalue(F.editcell.row,e.displayfield);var H=E;I={value:H,label:i}}else{I=E}var G=F.getrowdata(k);F._raiseEvent(18,{rowindex:k,row:G,datafield:u,displayfield:e.displayfield,oldvalue:E,value:E,columntype:e.columntype});F.editcell.editing=false};if(o){g(this);continue}if(e.cellvaluechanging){var n=this.getcellvalue(this.editcell.row,e.displayfield);var b=e.cellvaluechanging(k,u,e.columntype,n,l);if(b!=undefined){l=b}}var u=e.datafield;if(e.validation){var c=this.getcell(k,e.datafield);try{var w=e.validation(c,l);var r=this.gridlocalization.validationstring;if(w.message!=undefined){r=w.message}var t=typeof w=="boolean"?w:w.result;if(!t){if(w.showmessage==undefined||w.showmessage==true){this._showvalidationpopup(k,u,r)}h=true;this.editcell[e.datafield].validated=false;continue}}catch(z){this._showvalidationpopup(k,u,this.gridlocalization.validationstring);this.editcell[e.datafield].validated=false;h=true;continue}}if(e.displayfield!=e.datafield){var q=this.getcellvalue(this.editcell.row,e.displayfield);var x=this.editcell.value;n={value:x,label:q}}else{n=this.getcellvalue(this.editcell.row,e.displayfield)}d[e.datafield]={newvalue:l,oldvalue:n}}var y={};var s={};if(!h){this._hidecelleditor(false);for(var B=0;B<this.columns.records.length;B++){var e=this.columns.records[B];var u=e.datafield;if(e.hidden){continue}if(!e.editable){continue}var f=this.getrowdata(k);if(e.createwidget){continue}if(e.columntype=="checkbox"){var l=this.getcellvalue(k,e.displayfield);this._raiseEvent(18,{rowindex:k,row:f,datafield:e.datafield,displayfield:e.displayfield,oldvalue:l,value:l,columntype:e.columntype});continue}if(!d[e.datafield]){continue}var l=d[e.datafield].newvalue;var n=d[e.datafield].oldvalue;if(e.cellendedit){var A=e.cellendedit(k,u,e.columntype,n,l);if(A==false){this._raiseEvent(18,{rowindex:k,row:f,datafield:u,displayfield:e.displayfield,oldvalue:n,value:n,columntype:e.columntype});g(this);continue}}if(!this.source.updaterow){this._raiseEvent(18,{rowindex:k,row:f,datafield:e.datafield,displayfield:e.displayfield,oldvalue:n,value:l,columntype:e.columntype})}y[e.datafield]=l;s[e.datafield]=n}var j=this.getrowid(k);var f=this.getrowdata(k);a.each(y,function(i,F){if(F&&F.label!=undefined){var E=D.getcolumn(i);f[E.displayfield]=F.label;f[E.datafield]=F.value}else{f[i]=F}});if(!this.enablebrowserselection){this.host.addClass("jqx-disableselect");this.content.addClass("jqx-disableselect")}a.data(document.body,"jqxgrid.edit","");this.editcell=null;this.editchar=null;this.pushToHistory=true;if(this.source.updaterow&&!o){var m=false;var D=this;var t=function(I){var G=D.source.updaterow;D.source.updaterow=null;if(false==I){a.each(s,function(i,K){if(K&&K.label!=undefined){var J=D.getcolumn(i);f[J.displayfield]=K.label;f[J.datafield]=K.value}else{f[i]=K}});D.updaterow(j,f)}else{D.updaterow(j,f)}for(var F=0;F<D.columns.records.length;F++){var H=D.columns.records[F];var E=H.datafield;D._raiseEvent(18,{rowindex:k,datafield:H.datafield,row:f,displayfield:H.displayfield,oldvalue:s[H.datafield],value:f[H.displayfield],columntype:H.columntype})}D.source.updaterow=G};try{m=this.source.updaterow(j,f,t);if(m==undefined){m=true}}catch(z){m=false;return}}else{if(!o){this.updaterow(j,f)}this._renderrows(this.virtualsizeinfo)}}this.pushToHistory=false;if(p){this.editmode=v}return h},_selection:function(b){if("selectionStart" in b[0]){var g=b[0];var h=g.selectionEnd-g.selectionStart;return{start:g.selectionStart,end:g.selectionEnd,length:h,text:g.value}}else{var d=document.selection.createRange();if(d==null){return{start:0,end:g.value.length,length:0}}var c=b[0].createTextRange();var f=c.duplicate();c.moveToBookmark(d.getBookmark());f.setEndPoint("EndToStart",c);var h=d.text.length;return{start:f.text.length,end:f.text.length+d.text.length,length:h,text:d.text}}},_setSelection:function(e,b,d){if("selectionStart" in d[0]){d[0].focus();d[0].setSelectionRange(e,b)}else{var c=d[0].createTextRange();c.collapse(true);c.moveEnd("character",b);c.moveStart("character",e);c.select()}},findRecordIndex:function(g,c,b){var b=b;if(c){var e=b.length;for(var h=0;h<e;h++){var f=b[h];var d=f.label;if(g==d){return h}}}return -1},_destroyeditors:function(){var b=this;if(!this.columns.records){return}a.each(this.columns.records,function(f,j){var c=a.trim(this.datafield).split(" ").join("");switch(this.columntype){case"dropdownlist":var g=b.editors["dropdownlist_"+c];if(g){g.jqxDropDownList("destroy");b.editors["dropdownlist_"+c]=null}break;case"combobox":var k=b.editors["combobox_"+c];if(k){k.jqxComboBox("destroy");b.editors["combobox_"+c]=null}break;case"datetimeinput":var d=b.editors["datetimeinput_"+this.datafield];if(d){d.jqxDateTimeInput("destroy");b.editors["datetimeinput_"+c]=null}break;case"numberinput":var e=b.editors["numberinput_"+c];if(e){e.jqxNumberInput("destroy");b.editors["numberinput_"+c]=null}break;case"custom":case"template":if(b.destroyeditor){if(b.editors["templateeditor_"+c]){b.destroyeditor(b.editors["templateeditor_"+c]);b.editors["templateeditor_"+c]=null}}if(b.destroyeditor){var m=b.getrows.length();for(var l=0;l<m;l++){if(b.editors["customeditor_"+c+"_"+l]){b.destroyeditor(b.editors["customeditor_"+c+"_"+l],l);b.editors["customeditor_"+c+"_"+l]=null}}}break;case"textbox":default:var h=b.editors["textboxeditor_"+c];if(h){b.removeHandler(h,"keydown");b.editors["textbox_"+c]=null}break}});b.editors=new Array()},_showcelleditor:function(r,H,o,L,x){if(o==undefined){return}if(this.editcell==null){return}if(H.columntype=="checkbox"&&H.editable){if(this.editmode=="selectedrow"){if(!this._checkboxCells){this._checkboxCells=[]}this._checkboxCells[H.datafield]=o}return}if(x==undefined){x=true}if(this.editmode=="selectedrow"){this.editchar="";x=false}var F=H.datafield;var h=a(o);var t=this;var d=this.editcell.editor;var J=this.getcellvalue(r,F);var D=this.getcelltext(r,F);var k=this.hScrollInstance;var u=k.value;var j=parseInt(u);var K=this.columns.records.indexOf(H);this.editcell.element=o;if(this.editcell.validated==false){var I="";if(this.validationpopup){I=this.validationpopup.text()}this._showvalidationpopup(r,F,I)}var m=function(e){if(t.hScrollInstance.isScrolling()||t.vScrollInstance.isScrolling()){return}if(!x){return}if(t.isTouchDevice()){return}if(e){e.focus()}if(t.gridcontent[0].scrollTop!=0){t.scrolltop(Math.abs(t.gridcontent[0].scrollTop));t.gridcontent[0].scrollTop=0}if(t.gridcontent[0].scrollLeft!=0){t.gridcontent[0].scrollLeft=0}};switch(H.columntype){case"dropdownlist":if(this.host.jqxDropDownList){o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");var B=a.trim(H.displayfield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}if(B.indexOf(".")!=-1){B=B.replace(".","")}var l=this.editors["dropdownlist_"+E];d=l==undefined?a("<div style='border: none; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='dropdownlisteditor'></div>"):l;d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(l==undefined){d.prependTo(this.table);d[0].id="dropdownlisteditor"+this.element.id+E;var g=this.source._source?true:false;var y=null;if(!g){y=new a.jqx.dataAdapter(this.source,{autoBind:false,uniqueDataFields:[B],async:false,autoSort:true,autoSortField:B})}else{var q={localdata:JSON.parse(JSON.stringify(this.source.records)),datatype:this.source.datatype,async:false};y=new a.jqx.dataAdapter(q,{autoBind:false,async:false,uniqueDataFields:[B],autoSort:true,autoSortField:B})}var v=!H.createeditor?true:false;d.jqxDropDownList({hint:false,enableBrowserBoundsDetection:true,keyboardSelection:false,source:y,rtl:this.rtl,autoDropDownHeight:v,theme:this.theme,width:h.width(),height:h.height(),displayMember:B,valueMember:F});this.editors["dropdownlist_"+E]=d;if(H.createeditor){H.createeditor(r,J,d)}}if(H._requirewidthupdate){d.jqxDropDownList({width:h.width()})}var c=d.jqxDropDownList("listBox").visibleItems;if(!H.createeditor){if(c.length<8){d.jqxDropDownList("autoDropDownHeight",true)}else{d.jqxDropDownList("autoDropDownHeight",false)}}var J=this.getcellvalue(r,B);var A=this.findRecordIndex(J,B,c);if(L){if(J!=""){d.jqxDropDownList("selectIndex",A,true)}else{d.jqxDropDownList("selectIndex",-1)}}if(!this.editcell){return}if(this.editcell.defaultvalue!=undefined){d.jqxDropDownList("selectIndex",this.editcell.defaultvalue,true)}if(x){d.jqxDropDownList("focus")}}break;case"combobox":if(this.host.jqxComboBox){o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");var B=a.trim(H.displayfield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}if(B.indexOf(".")!=-1){B=B.replace(".","")}var s=this.editors["combobox_"+E];d=s==undefined?a("<div style='border: none; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='comboboxeditor'></div>"):s;d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(s==undefined){d.prependTo(this.table);d[0].id="comboboxeditor"+this.element.id+E;var g=this.source._source?true:false;var y=null;if(!g){y=new a.jqx.dataAdapter(this.source,{autoBind:false,uniqueDataFields:[B],async:false,autoSort:true,autoSortField:B})}else{var q={localdata:JSON.parse(JSON.stringify(this.source.records)),datatype:this.source.datatype,async:false};y=new a.jqx.dataAdapter(q,{autoBind:false,async:false,uniqueDataFields:[B],autoSort:true,autoSortField:B})}var v=!H.createeditor?true:false;d.jqxComboBox({hint:false,enableBrowserBoundsDetection:true,keyboardSelection:false,source:y,rtl:this.rtl,autoDropDownHeight:v,theme:this.theme,width:h.width(),height:h.height(),displayMember:B,valueMember:F});d.removeAttr("tabindex");d.find("div").removeAttr("tabindex");this.editors["combobox_"+E]=d;if(H.createeditor){H.createeditor(r,J,d)}}if(H._requirewidthupdate){d.jqxComboBox({width:h.width()-2})}var c=d.jqxComboBox("listBox").visibleItems;if(!H.createeditor){if(c.length<8){d.jqxComboBox("autoDropDownHeight",true)}else{d.jqxComboBox("autoDropDownHeight",false)}}var J=this.getcellvalue(r,B);var A=this.findRecordIndex(J,B,c);if(L){if(J!=""){d.jqxComboBox("selectIndex",A,true);d.jqxComboBox("val",J)}else{d.jqxComboBox("selectIndex",-1);d.jqxComboBox("val",J)}}if(!this.editcell){return}if(this.editcell.defaultvalue!=undefined){d.jqxComboBox("selectIndex",this.editcell.defaultvalue,true)}if(this.editchar&&this.editchar.length>0){d.jqxComboBox("input").val(this.editchar)}if(x){setTimeout(function(){m(d.jqxComboBox("input"));if(d){d.jqxComboBox("_setSelection",0,0);if(t.editchar){d.jqxComboBox("_setSelection",1,1);t.editchar=null}else{if(d.jqxComboBox("input")){var e=d.jqxComboBox("input").val();d.jqxComboBox("_setSelection",0,e.length)}}}},10)}}break;case"datetimeinput":if(this.host.jqxDateTimeInput){o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}var w=this.editors["datetimeinput_"+E];d=w==undefined?a("<div style='border: none; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='datetimeeditor'></div>"):w;d.show();d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(w==undefined){d.prependTo(this.table);d[0].id="datetimeeditor"+this.element.id+E;var G={calendar:this.gridlocalization};d.jqxDateTimeInput({hint:false,firstDayOfWeek:this.gridlocalization.firstDay,enableBrowserBoundsDetection:true,localization:G,_editor:true,theme:this.theme,rtl:this.rtl,width:h.width(),height:h.height(),formatString:H.cellsformat});this.editors["datetimeinput_"+E]=d;if(H.createeditor){H.createeditor(r,J,d)}}if(H._requirewidthupdate){d.jqxDateTimeInput({width:h.width()})}if(L){if(J!=""&&J!=null){var M=new Date(J);if(M=="Invalid Date"){if(this.source.getvaluebytype){M=this.source.getvaluebytype(J,{name:H.datafield,type:"date"})}}d.jqxDateTimeInput("setDate",M)}else{d.jqxDateTimeInput("setDate",null)}if(this.editcell.defaultvalue!=undefined){d.jqxDateTimeInput("setDate",this.editcell.defaultvalue)}}if(x){var N=this.editEvent;setTimeout(function(){m(d.jqxDateTimeInput("dateTimeInput"));setTimeout(function(){d.jqxDateTimeInput("_selectGroup",0);if(t.editchar&&t.editchar.length>0){var S=parseInt(t.editchar);if(!isNaN(S)){if(N){var e=N.charCode?N.charCode:N.keyCode?N.keyCode:0;d.jqxDateTimeInput("_handleKeyPress",N,e)}}}},25)},10)}}break;case"numberinput":if(this.host.jqxNumberInput){o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}var P=this.editors["numberinput_"+E];d=P==undefined?a("<div style='border:none; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='numbereditor'></div>"):P;d.show();d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(P==undefined){d.prependTo(this.table);d[0].id="numbereditor"+this.element.id+E;var n="";var z="left";var O=2;if(H.cellsformat){if(H.cellsformat.indexOf("c")!=-1){n=this.gridlocalization.currencysymbol;z=this.gridlocalization.currencysymbolposition;if(z=="before"){z="left"}else{z="right"}if(H.cellsformat.length>1){O=parseInt(H.cellsformat.substring(1),10)}}else{if(H.cellsformat.indexOf("p")!=-1){n=this.gridlocalization.percentsymbol;z="right";if(H.cellsformat.length>1){O=parseInt(H.cellsformat.substring(1),10)}}}}else{O=0}d.jqxNumberInput({decimalSeparator:this.gridlocalization.decimalseparator,decimalDigits:O,inputMode:"simple",theme:this.theme,rtl:this.rtl,width:h.width(),height:h.height(),spinButtons:true,symbol:n,symbolPosition:z});this.editors["numberinput_"+E]=d;if(H.createeditor){H.createeditor(r,J,d)}}if(H._requirewidthupdate){d.jqxNumberInput({width:h.width()})}if(L){if(J!=""&&J!=null){var R=J;d.jqxNumberInput("setDecimal",R)}else{d.jqxNumberInput("setDecimal",0)}if(this.editcell.defaultvalue!=undefined){d.jqxNumberInput("setDecimal",this.editcell.defaultvalue)}if(this.editchar&&this.editchar.length>0){var p=parseInt(this.editchar);if(!isNaN(p)){d.jqxNumberInput("setDecimal",p)}}if(x){setTimeout(function(){m(d.jqxNumberInput("numberInput"));d.jqxNumberInput("_setSelectionStart",0);if(t.editchar){if(H.cellsformat.length>0&&H.cellsformat.indexOf("c")>=0){d.jqxNumberInput("_setSelectionStart",2)}else{d.jqxNumberInput("_setSelectionStart",1)}t.editchar=null}else{var e=d.jqxNumberInput("spinButtons");if(e){var S=d.jqxNumberInput("numberInput").val();t._setSelection(d.jqxNumberInput("numberInput")[0],S.length,S.length)}else{var S=d.jqxNumberInput("numberInput").val();t._setSelection(d.jqxNumberInput("numberInput")[0],0,S.length)}d.jqxNumberInput("selectAll")}},10)}}}break;case"rating":if(this.host.jqxRating){o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}var Q=this.editors["rating_"+E];d=Q==undefined?a("<div style='margin: 5px;white-space: nowrap; overflow: auto; border:none; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='ratingEditor'></div>"):Q;d.show();d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(Q==undefined){d.prependTo(this.table);d[0].id="ratingEditor"+this.element.id+E;d.jqxRating({theme:this.theme,width:h.width(),height:h.height()});this.editors["numberinput_"+E]=d;if(H.createeditor){H.createeditor(r,J,d)}}if(H._requirewidthupdate){d.jqxRating({width:h.width()})}if(L){if(J!=""&&J!=null){var R=J;d.jqxRating("val",R)}else{d.jqxRating("val",0)}if(this.editcell.defaultvalue!=undefined){d.jqxRating("val",this.editcell.defaultvalue)}}}break;case"custom":o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}var C=this.editors["customeditor_"+E+"_"+r];d=C==undefined?a("<div style='overflow: hidden; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='customeditor'></div>"):C;d.show();d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(C==undefined){d.prependTo(this.table);d[0].id="customeditor"+this.element.id+E+"_"+r;this.editors["customeditor_"+E+"_"+r]=d;var b=h.width()-1;var f=h.height()-1;d.width(b);d.height(f);if(H.createeditor){H.createeditor(r,J,d,D,b,f,this.editchar)}}if(H._requirewidthupdate){d.width(h.width())}break;case"template":o.innerHTML="";var E=a.trim(H.datafield).split(" ").join("");if(E.indexOf(".")!=-1){E=E.replace(".","")}var i=this.editors["templateeditor_"+E];d=i==undefined?a("<div style='overflow: hidden; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; z-index: 799; top: 0px; left: 0px; position: absolute;' id='templateeditor'></div>"):i;d.show();d.css("top",a(o).parent().position().top);if(this.oldhscroll){d.css("left",-j+parseInt(a(o).position().left))}else{d.css("left",parseInt(a(o).position().left))}if(H.pinned){d.css("left",j+parseInt(a(o).position().left))}if(i==undefined){d.prependTo(this.table);d[0].id="templateeditor"+this.element.id+E;this.editors["templateeditor_"+E]=d;var b=h.width()-1;var f=h.height()-1;d.width(b);d.height(f);if(H.createeditor){H.createeditor(r,J,d,D,b,f,this.editchar)}}if(H._requirewidthupdate){d.width(h.width())}break;case"textbox":default:o.innerHTML="";d=this.editors["textboxeditor_"+H.datafield]||a("<input autocomplete='off' style='padding-left: 4px; padding-right:4px; border: none; border-color: transparent;' autocorrect='off' autocapitalize='off' spellcheck='false' type='textbox' id='textboxeditor'/>");d[0].id="textboxeditor"+this.element.id+H.datafield;d.appendTo(h);if(this.rtl){d.css("direction","rtl")}if(L||d[0].className==""){d.addClass(this.toThemeProperty("jqx-input"));d.addClass(this.toThemeProperty("jqx-widget-content"));if(this.editchar&&this.editchar.length>0){d.val(this.editchar)}else{if(H.cellsformat!=""){J=this.getcelltext(r,F)}if(J==undefined){J=""}d.val(J)}if(this.editcell.defaultvalue!=undefined){d.val(this.editcell.defaultvalue)}d.width(h.width()+1);d.height(h.height()+1);if(H.createeditor){H.createeditor(r,J,d)}if(H.cellsformat!=""){if(H.cellsformat.indexOf("p")!=-1||H.cellsformat.indexOf("c")!=-1||H.cellsformat.indexOf("n")!=-1||H.cellsformat.indexOf("f")!=-1){if(!this.editors["textboxeditor_"+H.datafield]){d.keydown(function(S){var Y=S.charCode?S.charCode:S.keyCode?S.keyCode:0;var V=String.fromCharCode(Y);var W=parseInt(V);if(isNaN(W)){return true}if(t._selection(d).length>0){return true}var U="";var T=d.val();if(H.cellsformat.length>1){var X=parseInt(H.cellsformat.substring(1));if(isNaN(X)){X=0}}else{var X=0}if(X>0){if(T.indexOf(t.gridlocalization.decimalseparator)!=-1){if(t._selection(d).start>T.indexOf(t.gridlocalization.decimalseparator)){return true}}}for(var Z=0;Z<T.length-X;Z++){var e=T.substring(Z,Z+1);if(e.match(/^[0-9]+$/)!=null){U+=e}}if(U.length>=11){return false}})}}}}this.editors["textboxeditor_"+H.datafield]=d;if(L){if(x){setTimeout(function(){m(d);if(t.editchar){t._setSelection(d[0],1,1);t.editchar=null}else{t._setSelection(d[0],0,d.val().length)}},25)}}break}if(d){d.addClass("jqx-grid-cell-edit");d[0].style.zIndex=1+parseInt(o.style.zIndex);if(a.jqx.browser.msie&&a.jqx.browser.version<8){d[0].style.zIndex=1+this.columns.records.length+o.style.zIndex}d.css("display","block");this.editcell.editor=d;if(!this.editcell[F]){this.editcell[F]={};this.editcell[F].editor=d}else{this.editcell[F].editor=d}}if(L){if(H.initeditor){H.initeditor(r,J,d,D,this.editchar)}}if(t.isTouchDevice()){return}setTimeout(function(){if(t.content){t.content[0].scrollTop=0;t.content[0].scrollLeft=0}if(t.gridcontent){t.gridcontent[0].scrollLeft=0;t.gridcontent[0].scrollTop=0}},10)},_setSelection:function(d,g,b){try{if("selectionStart" in d){d.setSelectionRange(g,b)}else{var c=d.createTextRange();c.collapse(true);c.moveEnd("character",b);c.moveStart("character",g);c.select()}}catch(e){var f=e}},_hideeditors:function(){if(this.editcells!=null){var b=this;for(var c in this.editcells){b.editcell=b.editcells[c];b._hidecelleditor()}}},_hidecelleditor:function(b){if(!this.editcell){return}if(this.editmode==="selectedrow"){for(var c=0;c<this.columns.records.length;c++){var e=this.columns.records[c];if(this.editcell[e.datafield]&&this.editcell[e.datafield].editor){this.editcell[e.datafield].editor.hide();var d=this.editcell[e.datafield].editor;switch(e.columntype){case"dropdownlist":d.jqxDropDownList({closeDelay:0});d.jqxDropDownList("hideListBox");d.jqxDropDownList({closeDelay:300});break;case"combobox":d.jqxComboBox({closeDelay:0});d.jqxComboBox("hideListBox");d.jqxComboBox({closeDelay:300});break;case"datetimeinput":if(d.jqxDateTimeInput("isOpened")){d.jqxDateTimeInput({closeDelay:0});d.jqxDateTimeInput("hideCalendar");d.jqxDateTimeInput({closeDelay:300})}break}}}if(this.validationpopup){this.validationpopup.hide();this.validationpopuparrow.hide()}return}if(this.editcell.columntype=="checkbox"){return}if(this.editcell.editor){this.editcell.editor.hide();switch(this.editcell.columntype){case"dropdownlist":this.editcell.editor.jqxDropDownList({closeDelay:0});this.editcell.editor.jqxDropDownList("hideListBox");this.editcell.editor.jqxDropDownList({closeDelay:300});break;case"combobox":this.editcell.editor.jqxComboBox({closeDelay:0});this.editcell.editor.jqxComboBox("hideListBox");this.editcell.editor.jqxComboBox({closeDelay:300});break;case"datetimeinput":var f=this.editcell.editor;if(f.jqxDateTimeInput("isOpened")){f.jqxDateTimeInput({closeDelay:0});f.jqxDateTimeInput("hideCalendar");f.jqxDateTimeInput({closeDelay:300})}break}}if(this.validationpopup){this.validationpopup.hide();this.validationpopuparrow.hide()}if(!this.isNestedGrid){if(b!=false){this.element.focus()}}},_geteditorvalue:function(h){var o=new String();if(!this.editcell){return null}var l=this.editcell.editor;if(this.editmode=="selectedrow"){if(this.editcell[h.datafield]){var l=this.editcell[h.datafield].editor}}if(l){switch(h.columntype){case"textbox":default:o=l.val();if(h.cellsformat!=""){var n="string";var e=this.source.datafields||((this.source._source)?this.source._source.datafields:null);if(e){var p="";a.each(e,function(){if(this.name==h.displayfield){if(this.type){p=this.type}return false}});if(p){n=p}}var i=n==="number"||n==="float"||n==="int"||n==="integer";var f=n==="date"||n==="time";if(i||(n==="string"&&(h.cellsformat.indexOf("p")!=-1||h.cellsformat.indexOf("c")!=-1||h.cellsformat.indexOf("n")!=-1||h.cellsformat.indexOf("f")!=-1))){if(o===""&&h.nullable){return""}if(o.indexOf&&o.indexOf(this.gridlocalization.currencysymbol)>-1){o=o.replace(this.gridlocalization.currencysymbol,"")}var m=function(w,u,v){var s=w;if(u==v){return w}var t=s.indexOf(u);while(t!=-1){s=s.replace(u,v);t=s.indexOf(u)}return s};var k=o;k=new Number(k);if(!isNaN(k)){return k}o=m(o,this.gridlocalization.thousandsseparator,"");o=o.replace(this.gridlocalization.decimalseparator,".");if(o.indexOf(this.gridlocalization.percentsymbol)>-1){o=o.replace(this.gridlocalization.percentsymbol,"")}var d="";for(var r=0;r<o.length;r++){var b=o.substring(r,r+1);if(b==="-"){d+="-"}if(b==="."){d+="."}if(b.match(/^[0-9]+$/)!=null){d+=b}}o=d;o=o.replace(/ /g,"");o=new Number(o);if(isNaN(o)){o=""}}if(f||(n==="string"&&(h.cellsformat.indexOf("H")!=-1||h.cellsformat.indexOf("m")!=-1||h.cellsformat.indexOf("M")!=-1||h.cellsformat.indexOf("y")!=-1||h.cellsformat.indexOf("h")!=-1||h.cellsformat.indexOf("d")!=-1))){if(o===""&&h.nullable){return""}var c=o;if(a.jqx.dataFormat){o=a.jqx.dataFormat.tryparsedate(c,this.gridlocalization)}if(o=="Invalid Date"||o==null){o=""}}}if(h.displayfield!=h.datafield){o={label:o,value:o}}break;case"checkbox":if(l.jqxCheckBox){o=l.jqxCheckBox("checked")}break;case"datetimeinput":if(l.jqxDateTimeInput){l.jqxDateTimeInput({isEditing:false});if(l.jqxDateTimeInput("container").css("display")!=="none"){l.jqxDateTimeInput("close")}l.jqxDateTimeInput("_validateValue");o=l.jqxDateTimeInput("getDate");if(o==null){return null}o=new Date(o.toString());if(h.displayfield!=h.datafield){o={label:o,value:o}}}break;case"dropdownlist":if(l.jqxDropDownList){var g=l.jqxDropDownList("selectedIndex");var q=l.jqxDropDownList("listBox").getVisibleItem(g);if(h.displayfield!=h.datafield){if(q){o={label:q.label,value:q.value}}else{o=""}}else{if(q){o=q.label}else{o=""}}if(o==null){o=""}}break;case"combobox":if(l.jqxComboBox){o=l.jqxComboBox("val");if(h.displayfield!=h.datafield){var q=l.jqxComboBox("getSelectedItem");if(q!=null){o={label:q.label,value:q.value}}}if(o==null){o=""}}break;case"numberinput":if(l.jqxNumberInput){if(this.touchdevice){l.jqxNumberInput("_doTouchHandling")}var j=l.jqxNumberInput("getDecimal");o=new Number(j);o=parseFloat(o);if(isNaN(o)){o=0}if(j===null){o=null}if(h.displayfield!=h.datafield){o={label:o,value:o}}}break}if(h.geteditorvalue){if(this.editmode=="selectedrow"){o=h.geteditorvalue(this.editcell.row,this.getcellvalue(this.editcell.row,h.datafield),l)}else{o=h.geteditorvalue(this.editcell.row,this.editcell.value,l)}}}return o},hidevalidationpopups:function(){if(this.popups){a.each(this.popups,function(){this.validation.remove();this.validationrow.remove()});this.popups=new Array()}if(this.validationpopup){this.validationpopuparrow.hide();this.validationpopup.hide()}},showvalidationpopup:function(f,j,h){if(h==undefined){var h=this.gridlocalization.validationstring}var g=a("<div style='z-index: 99999; top: 0px; left: 0px; position: absolute;'></div>");var r=a("<div style='width: 20px; height: 20px; z-index: 999999; top: 0px; left: 0px; position: absolute;'></div>");g.html(h);r.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));g.addClass(this.toThemeProperty("jqx-grid-validation"));g.addClass(this.toThemeProperty("jqx-rc-all"));g.prependTo(this.table);r.prependTo(this.table);var l=this.hScrollInstance;var n=l.value;var d=parseInt(n);var b=this.getcolumn(j).uielement;var p=null;for(var o=0;o<this.hittestinfo.length;o++){if(f===this.hittestinfo[o].row.visibleindex){p=this.hittestinfo[o]}}if(!p){this.ensurerowvisible(f);var s=this;g.remove();r.remove();setTimeout(function(){var v=null;for(var u=0;u<s.hittestinfo.length;u++){if(f===s.hittestinfo[u].row.visibleindex){v=s.hittestinfo[u]}}if(v){s.showvalidationpopup(f,j,h)}},25);return}var c=a(p.visualrow);g.css("top",parseInt(c.position().top)+30+"px");var k=parseInt(g.css("top"));r.css("top",k-12);r.removeClass();r.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));var q=false;if(k>=this._gettableheight()-this.rowsheight){r.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));r.addClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));k=parseInt(c.position().top)-this.rowsheight;if(k<0){k=0;this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));q=true}g.css("top",k+"px");r.css("top",k+g.outerHeight()-9)}var t=-d+parseInt(a(b).position().left);if(b[0].offsetHeight===0){t=-d+parseInt(b[0].style.left)}r.css("left",d+t+30);var m=g.width();if(m+t>this.host.width()-20){var e=m+t-this.host.width()+40;t-=e}if(!q){g.css("left",d+t)}else{g.css("left",d+parseInt(a(b).position().left)-g.outerWidth())}g.show();r.show();if(!this.popups){this.popups=new Array()}this.popups[this.popups.length]={validation:g,validationrow:r}},_showvalidationpopup:function(p,e,q){var c=this.editcell;var k=this.editcell.editor;if(this.editmode=="selectedrow"){var c=this.editcell[e];if(c&&c.editor){k=c.editor;c.element=k}}if(!k){return}if(this.validationpopup&&a.jqx.isHidden(this.validationpopup)){if(this.validationpopup.remove){this.validationpopup.remove();this.validationpopuparrow.remove()}this.validationpopup=null;this.validationpopuparrow=null;if(e===undefined&&q===undefined&&this.editors&&this.editors.length===0){return}}if(!this.validationpopup){var n=a("<div style='z-index: 99999; top: 0px; left: 0px; position: absolute;'></div>");var m=a("<div style='width: 20px; height: 20px; z-index: 999999; top: 0px; left: 0px; position: absolute;'></div>");n.html(q);m.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));n.addClass(this.toThemeProperty("jqx-grid-validation"));n.addClass(this.toThemeProperty("jqx-rc-all"));n.prependTo(this.table);m.prependTo(this.table);this.validationpopup=n;this.validationpopuparrow=m}else{this.validationpopup.html(q)}var h=this.hScrollInstance;var j=h.value;var g=parseInt(j);if(this.editmode=="selectedrow"){if(this.visiblerows&&this.visiblerows[this.editcell.visiblerowindex]){this.validationpopup.css("top",this.visiblerows[this.editcell.visiblerowindex].top+(this.rowsheight+5)+"px")}else{this.validationpopup.css("top",parseInt(a(c.editor).position().top)+(this.rowsheight+5)+"px")}}else{this.validationpopup.css("top",parseInt(a(c.element).parent().position().top)+(this.rowsheight+5)+"px")}var b=parseInt(this.validationpopup.css("top"));this.validationpopuparrow.css("top",b-11);this.validationpopuparrow.removeClass();this.validationpopuparrow.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));var o=this._gettableheight();var f=false;if(b>=o){this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));this.validationpopuparrow.addClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));b=parseInt(a(c.element).parent().position().top)-this.rowsheight-5;if(this.editmode=="selectedrow"){if(this.visiblerows&&this.visiblerows[this.editcell.visiblerowindex]){b=this.visiblerows[this.editcell.visiblerowindex].top-this.rowsheight-5}else{b=parseInt(a(c.editor).position().top)-this.rowsheight-5}}if(b<0){b=0;this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));f=true}this.validationpopup.css("top",b+"px");this.validationpopuparrow.css("top",b+this.validationpopup.outerHeight()-9)}var l=-g+parseInt(a(c.element).position().left);this.validationpopuparrow.css("left",g+l+30);var d=this.validationpopup.width();if(d+l>this.host.width()-20){var i=d+l-this.host.width()+40;l-=i}if(!f){this.validationpopup.css("left",g+l)}else{this.validationpopup.css("left",g+parseInt(a(c.element).position().left)-this.validationpopup.outerWidth())}if(this.editcell.editor.css("display")=="none"){this.validationpopup.hide();this.validationpopuparrow.hide()}else{this.validationpopup.show();this.validationpopuparrow.show()}}})})(jqxBaseFramework);
+

mercurial