<?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 help!</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/unformat-help</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-help/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Shift4SMS on unformat help!</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/unformat-help#p24657</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/unformat-help#p24657</guid>
        	        	<description><![CDATA[<p>I&#39;m fighting with unformat and I&#39;m hoping someone can help. I have a column that I have added a custom formatter:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;formatter:function(cellvalue, options, rowObject) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;return cellvalue + &#39; &#60;em&#62;(&#39; + rowObject[2]&#160;+ &#39;)&#60;/em&#62;&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;}</p>
</p>
<p>I would like to strip off the &#60;em&#62; work that the formatter did prior to editing so I created an unformat function:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;unformat:function(cellvalue, options) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;var re = new RegExp("\s*&#60;em&#62;.*?&#60;/em&#62;","g");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;return cellvalue.replace(re,&#39;&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;}</p>
</p>
<p>The problem I am running into is that for some reason, simply specifying "unformat" causes tags to be removed from the cell data. Example, the custom formatter receives the following: cellvalue="test", rowObject[2]="09/16/2011", return value = "test &#60;em&#62;(09/16/2011)&#60;/em&#62;"</p>
<p>If I do not specify unformat, the edit text = "test &#60;em&#62;(09/16/2011)&#60;/em&#62;" -- this is expected.</p>
<p>Ignoring my unformat above (because it is not working do to this strang behaviour) and simply defining unformat as:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;unformat:function(cellvalue, options) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;return cellvalue;<br />&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p>the edit text = "test (09/16/2011)" -- ARGH! This is the same value that unformat is receiving -- thus why my regular expression stripping is not working.</p>
<p>Am I doing something wrong or have I found a bug?</p>
]]></description>
        	        	<pubDate>Fri, 16 Sep 2011 22:37:40 +0300</pubDate>
        </item>
</channel>
</rss>