<?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: setCell issue with formatoptions</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-issue-with-formatoptions</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/setcell-issue-with-formatoptions/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>casperd on setCell issue with formatoptions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-issue-with-formatoptions#p17342</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-issue-with-formatoptions#p17342</guid>
        	        	<description><![CDATA[<div id="post17265">
<p>Hi,</p>
</p>
<p>My code:</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $("#tblActiveProjects").jqGrid({<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;url:&#39;../Data_Templates/DTM_Projects_Select.asp?FilterType=1&#38;TeamMemberType=1&#39;,<br />&#160;&#160;  &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;colNames: [&#39;Prj. No.&#39;,&#39;Project Name&#39;,  &#39;Status&#39;,&#39;RAG&#39;,&#39;Latest Update&#39;,&#39;&#39;,&#39;&#39;],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;colModel: [<br />&#160;&#160;  &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;ProjectNumber&#39;, width:80, align:&#39;center&#39;,  sorttype:&#39;text&#39;},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;ProjectName&#39;, width:300,  align:&#39;left&#39;, sorttype:&#39;text&#39;},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;{name:&#39;ProjectStatus&#39;, width:100, align:&#39;center&#39;, sorttype:&#39;text&#39;},<br />&#160;&#160;  &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;ProjectRAGIndicator&#39;, width:60, align:&#39;center&#39;,  sortable:false, formatter:RAG_formatter},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;{name:&#39;ProjectStatusDate&#39;, width:90, align:&#39;center&#39;, sorttype:&#39;date&#39;,  formatter:&#39;date&#39;, formatoptions:{srcformat: &#39;y/m/d&#39;, newformat:&#39;d M  Y&#39;}},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;LinkToDashboard&#39;, width:30,  align:&#39;center&#39;, hidden:true},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;{name:&#39;LinkToWorkspace&#39;, width:30, align:&#39;center&#39;, hidden:true}<br />&#160;&#160;  &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;height: 155,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;sortname: &#39;ProjectName&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;pager:  &#39;#pagerActiveProjects&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;gridview: false,<br />&#160;&#160; &#160;&#160;&#160;  &#160;&#160;&#160; &#160;&#160;&#160; &#160;afterInsertRow: function(rowid, aData){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;$("#tblActiveProjects").setCell(rowid,&#39;ProjectStatusDate&#39;,"&#60;a  href=&#39;PG_Dashboard.asp?ReportProjectID=" + rowid + "&#39; target=_new  title=&#39;Click the Latest Update Date to open then Project Dashboard&#39;&#62;"  + aData.ProjectStatusDate + "&#60;/a&#62;","gridLink");<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;  &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;});</p>
<p>The following issue:</p>
<p>1) I use the prededfined "date" formatter to format the column  "ProjectStatusDate";</p>
<p>2) I use the setCell method to add a link to the "ProjectStatusDate"  column after the row insert;</p>
<p>3) If I use this setCell method I lose the "d M Y" formatting on this  column. The dates are not displayed as &#39;18 May 2010&#39;, but as  &#39;2010/05/18&#39;.</p>
<p>4) If I don&#39;t use the setCell mthod, the dates are displayed  correctly.</p>
<p>Any ideas?</p>
</p>
<p>Thanks!</p>
</div>
]]></description>
        	        	<pubDate>Thu, 20 May 2010 17:59:08 +0300</pubDate>
        </item>
</channel>
</rss>