<?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 from inside fmatter</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter</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-from-inside-fmatter/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>newperson on setCell from inside fmatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13902</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13902</guid>
        	        	<description><![CDATA[<p>ari:</p>
<p>my example does have limitations, if you find a solution to yours can you share your code? Thanks!</p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 20:16:37 +0200</pubDate>
        </item>
        <item>
        	<title>ari on setCell from inside fmatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13880</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13880</guid>
        	        	<description><![CDATA[<p>For anyone finding this thread, there is a way to get the rowId. That info is carried in the options. So options.rowId can give you a hook for jQuery to then addClass to. I found that here:</p>
</p>
<p><a href="http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells&#038;value=sort%25251&#038;search=1" rel="nofollow" target="_blank"><a href="http://www.trirand.com/blog/?p" rel="nofollow">http://www.trirand.com/blog/?p</a>.....8;search=1</a></p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 04:16:07 +0200</pubDate>
        </item>
        <item>
        	<title>ari on setCell from inside fmatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13878</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13878</guid>
        	        	<description><![CDATA[<p>@newperson</p>
<p>Thanks for your help and example. I did Google this for hours, and found only something similar to your idea on stackoverflow.com. Your example works well for certain things, but it doesn&#39;t do what I want which is to apply css to the tr or the td, rather than just inserting html. And it also doesn&#39;t work for setting the background colour.</p>
</p>
<p>@tony</p>
<p>afterInsertRow might be a better approach and I&#39;ll explore that. Thanks. You might like to add newperson&#39;s example to your docs since I&#39;m sure that will help a lot of people (just not what I want to do here). Ideally, I wanted to apply a style to the tr so that certain rows are bold or have a different background, depending on the value of one column. So afterInsertRow may do the trick.</p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 02:47:10 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on setCell from inside fmatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13871</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13871</guid>
        	        	<description><![CDATA[<p>This post has been made many times and with a little forum searching you could find answer.</p>
<p><strong>your js file</strong>.js</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3188' value='Select Code' data-codeid='sfcode3188' /></p>
<div class='sfcode' id='sfcode3188'>
<p><strong>...</strong></p>
<p>colModel: [</p>
<p>...</p>
<p>{ name: &#39;Items&#39;, index: &#39;item_count&#39;, width: 80, align: "center", searchoptions: { sopt: [&#39;eq&#39;, &#39;ne&#39;, &#39;lt&#39;, &#39;le&#39;, &#39;gt&#39;, &#39;ge&#39;] }, formatter: highlight },</p>
<p><strong>...</strong></p>
<p>&#160;&#160;&#160; function highlight (cellvalue, options, rowObject) <br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var color = (parseInt(cellvalue) &#60; 10000) ? "red" : "green";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var cellHtml = "&#60;span style=&#39;color:" + color + "&#39; originalValue=&#39;" + cellvalue + "&#39;&#62;" + cellvalue + "&#60;/span&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return cellHtml;<br />&#160;&#160;&#160; }</p>
</div>
<p><span class="Apple-style-span" style="border-collapse: separate; color: #000000; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: &#39;Segoe UI&#39;; font-size: 12px; white-space: pre;"><a href="http://gyazo.com/f6958571ed5ac5102327e0608d35ab83.png" rel="nofollow" target="_blank">http://gyazo.com/f6958571ed5ac5102327e0608d35ab83.png</a> </span></span></p>
<p>This screenshot shows it in action, it will only change the color for cells with values under 100000 in red all others in green</p></p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 22:03:17 +0200</pubDate>
        </item>
        <item>
        	<title>tony on setCell from inside fmatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13854</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13854</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>This will not work written this way. Also in the formatter do not use jQuery commands that are related to grid contents)</p>
<p>One possible solutionis to use afterInsertRow event - it will work with yor code</p>
<p>What you mean with row number?</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 18:41:27 +0200</pubDate>
        </item>
        <item>
        	<title>ari on setCell from inside fmatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13793</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setcell-from-inside-fmatter#p13793</guid>
        	        	<description><![CDATA[<p>I have a cell which I&#39;d like to format based on the value of the contents. You know, the usual thing: make the background red if the text has a certain value. It seems to me that the obvious approach is something like this:</p>
</p>
<p>jQuery.extend(jQuery.fn.fmatter , {<br />&#160;&#160;&#160; myFormatter : function(cellvalue, options, rowdata) {<br />&#160;&#160;&#160; &#160;&#160;&#160; jQuery("#my_list").setCell(rowdata.rowNum, &#39;colName&#39;, &#39;&#39;, &#39;redcss&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return cellvalue;<br />&#160;&#160;&#160; }<br />});</p>
</p>
<p>Is this approach doomed to failure? Is there a way of getting the current row number out of the rowdata? I could hardcode the column name, but that would be nice too.</p>
</p>
<p>Any ideas?</p>
</p>
<p>Thanks</p>
<p>Ari</p>
]]></description>
        	        	<pubDate>Tue, 12 Jan 2010 14:02:47 +0200</pubDate>
        </item>
</channel>
</rss>