 <p>I would recommend you to use</p> <pre class="lang-js prettyprint-override"><code>editoptions: { maxlength: 8} </code></pre> <p>instead of the custom validation which you use. In the case the input element will be created with the <a href="http://www.w3schools.com/tags/att_input_maxlength.asp" rel="nofollow">maxlength</a> attribute directly. So the user will not able to type more as characters as specified by <code>maxlength</code>.</p> <p><strong>UPDATED</strong>: You can't change the interface of any callback function, but you can do share common code of different <code>custom_func</code> in the following way. You define your custom validation function having three parameters like</p> <pre class="lang-js prettyprint-override"><code>function validLen (value, colName, valueLength) { if (value.length === valueLength) { return [true, ""]; } else { return [false, "fail"]; } } </code></pre> <p>and use it in the following way</p> <pre class="lang-js prettyprint-override"><code>{ name: 'cntrct_id', editrules: { custom: true, custom_func: function (value, colName) { return validLen(value, colName, 8); } } </code></pre> <p>If you need to use <code>this</code> inside of <code>custom_func</code> then you can change <code>return validLen(value, colName, 8);</code> to <code>return validLen.call(this, value, colName, 8);</code>.</p>