<?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: Custom format function and edit actions</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-format-function-and-edit-actions</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/custom-format-function-and-edit-actions/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Custom format function and edit actions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-format-function-and-edit-actions#p7375</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-format-function-and-edit-actions#p7375</guid>
        	        	<description><![CDATA[<p>Hello Marcel,</p>
<p>If you use custom formatter you should custom unformat the value when you edit. If you use the inline editing I think the best place for this is to use datInit event in edit options in colModel.</p>
<p>dataInit : function (elm) {</p>
<p>// here the code to remove the span if available in the input elm value</p>
<p>}</p>
<p>Also I found a little bug, so you will need to download the latest code from GitHub.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 21 Jun 2009 06:53:38 +0300</pubDate>
        </item>
        <item>
        	<title>Marcel Karras on Custom format function and edit actions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-format-function-and-edit-actions#p7336</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-format-function-and-edit-actions#p7336</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I planned to give all date strings that are in the past a red color and all other ones the default one (black). So my attempt was on creating a custom formatter that works as a hook to the date formatter (currently without date comparison):</p>
<pre>deadline_formatter = function (cellval, opts){<br />&#160;&#160;&#160; var newdate = $.fmatter.util.DateFormat("Y-m-d",cellval,"d.m.Y",$.jgrid.formatter.date); <br />&#160;&#160;&#160; return "&#60;span style=\\"color:red\\"&#62;"+newdate+"&#60;/span&#62;";<br />}</pre>
<p>This works for me and shows all dates in red color. But when I enable field editing the edittype "text" with the value "&#60;span ..." is used. Inside the formatter plugin code I found out that the "date" formatter accepts a third parameter called "act" that will be of value "edit" on edit process. I cannot see any hookup possibilty for custom formatters to get rid of an active edit process. The only way I can think of how to overcome this is to manually replace the field value inside the onSelectRow callback...</p>
<p>Is there another way to get the things done to me?</p>
<p>Greetings.</p>
]]></description>
        	        	<pubDate>Fri, 19 Jun 2009 05:10:42 +0300</pubDate>
        </item>
</channel>
</rss>