<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Pass column name to custom_func for validation</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>SeanP on Pass column name to custom_func for validation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation#p28368</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation#p28368</guid>
        	        	<description><![CDATA[<p>Thanks, I&#39;ll change my code to reflect that.</p>
]]></description>
        	        	<pubDate>Fri, 01 Mar 2013 18:22:57 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Pass column name to custom_func for validation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation#p28356</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation#p28356</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Thanks. Good idea, but I want to add not so much code and do more things.</p>
<p>So I added the valref as parameter to the custom_func.</p>
<p>In your code your code to get the name from colmodel you just do</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1459' value='Select Code' data-codeid='sfcode1459' /></p>
<div class='sfcode' id='sfcode1459'>
<p>custom_func : function( val, label, colIndex) {</p>
<p>...</p>
<p>var colnm = this.p.colModel[colIndex].name;</p>
<p>...</p>
<p>}</p>
</div>
<p>Hope this is more usefull.</p>
<p>Thanks</p>
</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 01 Mar 2013 09:51:42 +0200</pubDate>
        </item>
        <item>
        	<title>SeanP on Pass column name to custom_func for validation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation#p28343</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/pass-column-name-to-custom_func-for-validation#p28343</guid>
        	        	<description><![CDATA[<p>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:</p>
</p>
<blockquote>
<pre> 	checkValues : function(val, valref,g, customobject, nam) {
-		var edtrul,i, nm, dft, len;
+		var edtrul,i, nm, dft, len, colnm;
 		if(customobject === undefined) {
 			if(typeof valref===&#39;string&#39;){
 				for( i =0, len=g.p.colModel.length;i&#60;len; i++){
@@ -6093,6 +6093,7 @@
 		}
 		if(edtrul) {
 			if(!nm) { nm = g.p.colNames[valref]; }
+            colnm = g.p.colModel[valref].name;
 			if(edtrul.required === true) {
 				if( $.jgrid.isEmpty(val) )  { return [false,nm+": "+$.jgrid.edit.msg.required,""]; }
 			}
@@ -6147,7 +6148,7 @@
 			if(edtrul.custom === true) {
 				if( !(rqfield === false &#38;&#38; $.jgrid.isEmpty(val)) ) {
 					if($.isFunction(edtrul.custom_func)) {
-						var ret = edtrul.custom_func.call(g,val,nm);
+						var ret = edtrul.custom_func.call(g,val,nm, colnm);
 						return $.isArray(ret) ? ret : [false,$.jgrid.edit.msg.customarray,""];
 					}
 					return [false,$.jgrid.edit.msg.customfcheck,""];
</pre>
</blockquote>
]]></description>
        	        	<pubDate>Wed, 27 Feb 2013 22:21:25 +0200</pubDate>
        </item>
</channel>
</rss>