<?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: new editrule regex</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex</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/new-editrule-regex/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on new editrule regex</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22391</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22391</guid>
        	        	<description><![CDATA[<p>I am not sure, Tony what is the best way. Probably you are right, but on the other side if you compare the problem with the same problem of the validation plugin you will see that many people find interesting <a href="http://stackoverflow.com/questions/280759/jquery-validate-how-to-add-a-rule-for-regular-expression-validation" target="_blank">the question</a>. They also missing the&#160;<strong>regular expression</strong>&#160;validator and find it practical (24 reputation points for the question and 48 reputation points for <a href="http://stackoverflow.com/questions/280759/jquery-validate-how-to-add-a-rule-for-regular-expression-validation/709358#709358" target="_blank">the solution</a>).</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 22:46:14 +0200</pubDate>
        </item>
        <item>
        	<title>tony on new editrule regex</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22388</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22388</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Maybe you are right, but user which can write regExp, can probably read that there is a custom fuction to do this &#160;<img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" />&#160;<img class="spSmiley" style="margin:0" title="Wink" src="/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" /></p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 13:42:37 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on new editrule regex</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22387</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22387</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>I agree with you that one can implement all with respect of custom verification rule, but the approach has some disadvantages.</p>
<p>If somebody is new in jqGrid he try to understand and use standard "predefined" features. It is good if he find out that formatter are exist. Then he look through the <strong>sandard</strong> verification rules and use one from there. Less then 30% of the user will use custom verification rule. So if you think from the point of view of new or not advanced users you will see that <strong>predefined</strong> regex formatter can has some advantages.</p>
<p>The feature is of course not very important, it is more cosmetical nature and just want to makes some thing to be used easier. I suggested this only after have seen some questions which can be easy solved by the formatter. It seems to me that at least 90% of custom verification rules do just test for regex.</p>
<p>Best regards<br />Oleg</p></p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 13:06:38 +0200</pubDate>
        </item>
        <item>
        	<title>tony on new editrule regex</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22385</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22385</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Thank you, but I think we have too much options - this not quite good.</p>
<p>Also this can be done easy with custom definition - if this can be done with the custom ruler definition then there is no need to write additional one.</p>
</p>
<p>Thank you anyway.</p>
<p>Kind Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 12 Mar 2011 12:38:24 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on new editrule regex</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22277</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/new-editrule-regex#p22277</guid>
        	        	<description><![CDATA[<p>Hello Tony!</p>
<p>I suggest very simple, but how I hope powerful <a href="/jqgridwiki/doku.php?id=wiki:common_rules#editrules" target="_blank">editrule</a>&#160;which could be used like</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5763' value='Select Code' data-codeid='sfcode5763' /></p>
<div class='sfcode' id='sfcode5763'>editrules:{regex:/^(foo&#124;bar)$/, required:true}</div>
<p>or</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6641' value='Select Code' data-codeid='sfcode6641' /></p>
<div class='sfcode' id='sfcode6641'>var myNameEditRegEx = new RegExp(&#34;^(foo&#124;bar)$&#34;);<br />...<br />editrules:{regex:myNameEditRegEx, required:true}</div>
<p>The corresponding change in the code of <strong>grid.common.js</strong> is simple. One can insert for example after the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.common.js#L610" target="_blank">610</a>&#160;the following code fragment</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8005' value='Select Code' data-codeid='sfcode8005' /></p>
<div class='sfcode' id='sfcode8005'>if(Object.prototype.toString.call(edtrul.regex) === &#34;[object RegExp]&#34; &#124;&#124; edtrul.regex instanceof RegExp) {<br />&#160;&#160; &#160;if( !(rqfield === false &#38;&#38; this.isEmpty(val)) ) {<br />&#160;&#160; &#160; &#160; &#160;if(!edtrul.regex.test(val)) {return [false,nm+&#34;: &#34;+$.jgrid.edit.msg.regex + &#34; &#34; + edtrul.regex,&#34;&#34;];}<br />&#160;&#160; &#160;}<br />}&#160;</div>
<p>The rule for the sesting of the regex type I get from <a href="http://stackoverflow.com/questions/280759/jquery-validate-how-to-add-a-rule-for-regular-expression-validation" target="_blank">here</a>.<br />I create <a href="http://www.ok-soft-gmbh.com/jqGrid/RegExEditRule.htm" target="_blank">the small demo</a>&#160;which use <strong>regex:/^(foo&#124;bar)$/</strong> in the &#39;Client&#39; column. Only two values will be valide "foo" and "bar". To go in the inline editing mode one should use double.click.</p>
<p>The most problem I see in <strong>$.jgrid.edit.msg.regex</strong> string which should be localized, but <a href="http://translate.google.com/" target="_blank">http://translate.google.com</a>&#160;can do produce the first version of the translations.</p>
<p>By the way if would be very nice to modify <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.inlinedit.js#L132" target="_blank">lines 131-136</a> of grid.inlinedit.js to permit more customization of the validation errors.</p>
<p>I hope that regex could reduce the requirement to use of <strong>custom</strong> edit rule.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Wed, 02 Mar 2011 16:09:01 +0200</pubDate>
        </item>
</channel>
</rss>