<?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: unformat and sorting w/v3.7.2</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/unformat-and-sorting-wv3-7-2</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/unformat-and-sorting-wv3-7-2/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jakemonO on unformat and sorting w/v3.7.2</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/unformat-and-sorting-wv3-7-2#p23618</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/unformat-and-sorting-wv3-7-2#p23618</guid>
        	        	<description><![CDATA[<p>I&#39;ve been using jqGrid 3.7.2 for over a year &#38; its working fine. I now have a numeric column in which I don;t want zero values to show up and I want sortable. I created a custom formatter to strip out zeroes and an unformatter to put them back in for sorting algorithm purposes. I&#39;ve tried using not a "" as a zero replacement and "&#38;nbsp;" but I can&#39;t seem to get the unformatter to work and the sort breaks. Any help/suggestions are appreciated. I&#39;d prefer NOT to upgrade the grid version at this time, but if that&#39;s a definitive answer I&#39;d consider it. Informal testing suggests the problem exists w/v3.8.2 and 4.1.0.</p>
</p>
<p>Formatter &#38; unformatter:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6172' value='Select Code' data-codeid='sfcode6172' /></p>
<div class='sfcode' id='sfcode6172'>function noZeroNumberFormatter(el, cellvalue, rowObject) {<br />&#160;&#160;&#160; if (window.console) console.log(&#34;noZeroNumberFormatter - before: &#34; + el + &#34;, after: &#34; + ((el == &#34;&#34;) ? &#34;&#38;nbsp;&#34; : el));<br />&#160;&#160;&#160; return (el == &#34;0&#34;) ? &#34;&#38;nbsp;&#34;: el;<br />}</p>
<p>function noZeroNumberUnformatter(el, cellvalue, rowObject) {<br />&#160;&#160;&#160; if (window.console) console.log(&#34;noZeroNumberUnformatter - before: &#34; + el + &#34;, after: &#34; + ((el == &#34;&#38;nbsp;&#34;) ? 0 : parseInt(el,10)));<br />&#160;&#160;&#160; return (el == &#34;&#38;nbsp;&#34;) ? 0 : parseInt(el,10);<br />}</p>
</div>
<p>(as explained, I&#39;ve tried non breakable space <span style="text-decoration: underline;">and</span> "" literal)</p>
</p>
<p>col def:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6416' value='Select Code' data-codeid='sfcode6416' /></p>
<div class='sfcode' id='sfcode6416'>{name: &#39;dQtry&#39;, label:&#39;Damage Qty&#39;, sortable: true, title: false, align: &#39;center&#39;, formatter: noZeroNumberFormatter, unformat: noZeroNumberUnformatter, sortttype: &#39;number&#39;, width: 40},</div>
</p>
<p>Thanks in advance!</p></p>
]]></description>
        	        	<pubDate>Wed, 15 Jun 2011 17:53:44 +0300</pubDate>
        </item>
</channel>
</rss>