The checkValues function currently passes the value and column label, but in my case I have several columns with the same label, but different names and ids, which need to validate against another column depending on the name of the column to be validated. So I propose the following change to checkValues to pass the column name in addition to the column label:
1234567891011121314151617181920212223 checkValues : function(val, valref,g, customobject, nam) {<br />- var edtrul,i, nm, dft, len;<br />+ var edtrul,i, nm, dft, len, colnm;<br />if(customobject === undefined) {<br />if(typeof valref==='string'){<br />for( i =0, len=g.p.colModel.length;i<len; i++){<br />@@ -6093,6 +6093,7 @@<br />}<br />if(edtrul) {<br />if(!nm) { nm = g.p.colNames[valref]; }<br />+ colnm = g.p.colModel[valref].name;<br />if(edtrul.required === true) {<br />if( $.jgrid.isEmpty(val) ) { return [false,nm+": "+$.jgrid.edit.msg.required,""]; }<br />}<br />@@ -6147,7 +6148,7 @@<br />if(edtrul.custom === true) {<br />if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {<br />if($.isFunction(edtrul.custom_func)) {<br />- var ret = edtrul.custom_func.call(g,val,nm);<br />+ var ret = edtrul.custom_func.call(g,val,nm, colnm);<br />return $.isArray(ret) ? ret : [false,$.jgrid.edit.msg.customarray,""];<br />}<br />return [false,$.jgrid.edit.msg.customfcheck,""];<br />
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top