<?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: Number formats in form edit, decimal point or comma</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma</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/help/number-formats-in-form-edit-decimal-point-or-comma/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>wizrd66 on Number formats in form edit, decimal point or comma</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p27019</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p27019</guid>
        	        	<description><![CDATA[<p>&#160;To fix this issue, I changed from using the built in edtrul.number to use edtrul.custom</p>
<p>sim to this</p>
<pre>col.editrules.custom&#160;=&#160;true;
&#160;col.editrules.custom_func&#160;=&#160;(function&#160;(val,&#160;nm)&#160;{&#160;if&#160;(isNaN(val.replace(decimalsep,&#160;&#39;.&#39;)))&#160;{&#160;return&#160;[false,&#160;nm&#160;+&#160;":&#160;"&#160;+&#160;$.jgrid.edit.msg.number]&#160;}&#160;return&#160;[true,&#160;""]&#160;});</pre>
]]></description>
        	        	<pubDate>Wed, 25 Jul 2012 17:12:15 +0300</pubDate>
        </item>
        <item>
        	<title>wizrd66 on Number formats in form edit, decimal point or comma</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p27008</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p27008</guid>
        	        	<description><![CDATA[<p>I am having the exact same issue.</p>
<div>I am doing an inline edit and the language settings are set to spanish. So the number&#160;formatting is a comma for decimalseparator and period for thousands separator. &#160;We have written unformat and format functions all is good there.</div>
<div>When a user edits a row, and they lets put in 26000,50 and they hit enter. The Grid throws an error. where 26000.50 is ok. Our users want to be able to put in a comma. I have seen posting on this and no real suitable fix ..&#160; It seems to me that this would be a common request and that being able to enter a number in the lanquage type you have selected would be expected.</div>
<div>&#160;</div>
<div>I tracked the issue down to this section of code, in the jqgrid code in the checkvalues function.</div>
<div><strong>&#160;</strong></div>
<div><strong>&#160;</strong></div>
<div><strong>if(edtrul.number === true) {<br />if( !(rqfield === false &#38;&#38; this.isEmpty(val)) ) {<br />if(isNaN(val)) { return [false,nm+": "+$.jgrid.edit.msg.number,""]; }<br />}</strong></div>
<div>the isNaN(val) check of course fails.. &#160;</div>
<div>I was wondering wouldn&#39;t&#160;</div>
<div>
<pre>if(isNaN(val.replace(opts.decimalSeparator,".")))
</pre>
<pre>Be a better check? or is there someway to run unformat on this before is runs the saverow function?</pre>
<pre>I would think you would re-run unformat after the user edits the data for a row. </pre>
<pre><span style="color: #ffff00;">&#160;</span></pre>
</div>
<div>
<pre>if(edtrul)&#160;{
			if(!nm)&#160;{&#160;nm&#160;=&#160;g.p.colNames[valref];&#160;}
			if(edtrul.required&#160;===&#160;true)&#160;{
				if(&#160;this.isEmpty(val)&#160;)&#160;&#160;{&#160;return&#160;[false,nm+":&#160;"+$.jgrid.edit.msg.required,""];&#160;}
			}
			//&#160;force&#160;required
			var&#160;rqfield&#160;=&#160;edtrul.required&#160;===&#160;false&#160;?&#160;false&#160;:&#160;true;
			<span style="color: #000000;"><strong>if(edtrul.number&#160;===&#160;true)&#160;{
				if(&#160;!(rqfield&#160;===&#160;false&#160;&#38;&#38;&#160;this.isEmpty(val))&#160;)&#160;{
					if(isNaN(val))&#160;{&#160;return&#160;[false,nm+":&#160;"+$.jgrid.edit.msg.number,""];&#160;}
				}</strong></span></pre>
</div>
]]></description>
        	        	<pubDate>Tue, 24 Jul 2012 20:58:30 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Number formats in form edit, decimal point or comma</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p18062</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p18062</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You can avoid this, suppessing the checking und use your own formatter and unformatter to return the original value.</p>
<p>The reason that you have a error when you enter a number with decimal separator "," is that the javascript isNaN function work only with numbers that have decimal separator ".".</p>
<p>Also you can define your own validator for your number.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 11:15:49 +0300</pubDate>
        </item>
        <item>
        	<title>caroig on Number formats in form edit, decimal point or comma</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p17912</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/number-formats-in-form-edit-decimal-point-or-comma#p17912</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I&#39;m using v3.6.5 and it works great. &#160;But I have a problem with my number formats. &#160;My system is in spanish and I&#39;m loading the spanish localization and using formatter to get the grid data displaying correctly - so far so good. &#160;</p>
<p>I&#39;m using formatter in my colModel and all my floats display fine with a comma decimal separator (e.g. 12,53). &#160;When I come to edit or add new rows, the data displayed in the popup form shows floats with a dot seperator (e.g. 12.53).</p>
<p>If I enter numbers in the edit form with the dot decimal separator e.g. 12.53 - they are displayed correctly in the grid e.g. 12,53. &#160;</p>
<p>If I enter data in the form with the comma separator, I get a validation error (from formatter I guess) that the field is not numeric.</p>
<p>What do I need to do to ensure that my form displays and validates numbers with a comma decimal seperator.</p>
</p>
<p>P.S. My data is not bound I use a dummy fille for the editurl and set reloadAfterSubmit:false on edit</p></p>
]]></description>
        	        	<pubDate>Mon, 14 Jun 2010 22:00:34 +0300</pubDate>
        </item>
</channel>
</rss>