<?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: Use predefined formatter from custom formatter</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/use-predefined-formatter-from-custom-formatter-1</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/use-predefined-formatter-from-custom-formatter-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>frodeo on Use predefined formatter from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/use-predefined-formatter-from-custom-formatter-1#p12158</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/use-predefined-formatter-from-custom-formatter-1#p12158</guid>
        	        	<description><![CDATA[<p>This works:</p>
</p>
<p>function myFormatter(cellvalue, options, rowObject)<br />{&#160;&#160; <br />&#160;&#160;&#160; if (cellvalue &#38;&#38; !isNaN(cellvalue))<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!options.colModel.formatoptions)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; options.colModel.formatoptions = {};</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (cellvalue == 0 &#124;&#124; cellvalue &#62;= 10)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; options.colModel.formatoptions.decimalPlaces = 2;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else if (cellvalue &#62;= 1)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; options.colModel.formatoptions.decimalPlaces = 3;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; options.colModel.formatoptions.decimalPlaces = 4;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return $.fn.fmatter.number(cellvalue,options);<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return &#39;-&#39;;<br />}</p>
]]></description>
        	        	<pubDate>Thu, 19 Nov 2009 02:30:18 +0200</pubDate>
        </item>
        <item>
        	<title>frodeo on Use predefined formatter from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/use-predefined-formatter-from-custom-formatter-1#p12090</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/use-predefined-formatter-from-custom-formatter-1#p12090</guid>
        	        	<description><![CDATA[<p>Is it possible to use one of the predefined formatters from a custom formatter? I want the formatoptions to depend on the cell value, so I need a custom formatter. But after deciding on the formatoptions it would be nice to be able to use the predefined formatter.</p>
<p>Example: I want to use a formatter=&#39;number&#39;, but I want decimalPlaces to depend on the cell value: decimalPlaces:2 if cellvalue &#62; 10, else decimalPlaces:3 if cellValue &#62; 1, else decimalPlaces:4.</p>
</p>
<p>Frode</p>
]]></description>
        	        	<pubDate>Tue, 17 Nov 2009 16:32:14 +0200</pubDate>
        </item>
</channel>
</rss>