<?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: How to getCell value from custom formatter</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter</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/how-to-getcell-value-from-custom-formatter/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>mb_iceman on How to getCell value from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p27185</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p27185</guid>
        	        	<description><![CDATA[<p>msshushu,</p>
</p>
<p>I don&#39;t think OlegK understands what you&#39;re asking for. I&#39;ve encountered the same issue as you too.</p>
<p>My solution was to generate my own map of field name to column index as part of initialising my grid.</p>
</p>
<p>Rough JS psuedocode:</p>
<p>grid = jQuery("#grid").jqGrid({colModel:myColModelCallback });</p>
</p>
<p>myColModelCallback {</p>
<p>colModel = [{name:&#39;col1&#39;},{name:&#39;col2&#39;}];</p>
<p>global var colModelMapping = {};</p>
<p>colModel.each(function(index,value) {</p>
<p>&#160; colModelMapping[value.name] = index;</p>
<p>});</p>
<p>return colModel;</p>
<p>}</p>
</p>
<p>So after the grid is initialised but before it has applied the formatters I can now use this global variable colModelMapping like so:</p>
<p>function myFormatter(cellvalue, options, rowObject) {</p>
<p>&#160; console.log(&#39;Value of col2 is: &#39; + rowObject[colModelMapping[&#39;col2&#39;]]);</p>
<p>}</p>
</p>
<p>Hope this helps, its not an ideal situation as far as I&#39;m concerned, jqGrid should really let us get to other cell values in a much more robust manner.</p>
]]></description>
        	        	<pubDate>Thu, 23 Aug 2012 02:29:14 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on How to getCell value from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19842</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19842</guid>
        	        	<description><![CDATA[<p>The function getCell use formatter to get the value. The formatter test whether the <strong>unformatter</strong>&#160;are&#160;defined (whether <strong>unformat</strong> exist) and if it is defined it use the value returned by your custom unformatter. So just try to do what I suggested. It should work.</p>
<p>Regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Fri, 17 Sep 2010 22:34:52 +0300</pubDate>
        </item>
        <item>
        	<title>msshushu on How to getCell value from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19841</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19841</guid>
        	        	<description><![CDATA[<p>Hi Oleg,</p>
</p>
<p>I appreciate the response, but I&#39;m not sure how the <strong>unformatter </strong>will solve my problem. Basically whether I use an <strong>unformatter </strong>or a <strong>formatter</strong>, how do i get another cell&#39;s value from within the <strong>formatter</strong>? the <strong>options </strong>object returns the information for the column it&#39;s applied to.</p>
</p>
<p>So if i apply a formatter to the Title column in the colModel, how do I access let&#39;s say the Manager cell?</p>
</p>
<p>Unless I&#39;m not understanding something, is there someway that the <strong>options </strong>object contains the info I need?</p>
]]></description>
        	        	<pubDate>Fri, 17 Sep 2010 21:39:39 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on How to getCell value from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19829</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19829</guid>
        	        	<description><![CDATA[<p>You should implement <a href="/jqgridwiki/doku.php?id=wiki:custom_formatter#unformatting" target="_blank">custom unformatter</a> always together with the <a href="/jqgridwiki/doku.php?id=wiki:custom_formatter#custom_formatter" target="_blank">custom formatter</a>. It seems to me that it will solve your problem.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Fri, 17 Sep 2010 14:28:00 +0300</pubDate>
        </item>
        <item>
        	<title>msshushu on How to getCell value from custom formatter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19825</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-getcell-value-from-custom-formatter#p19825</guid>
        	        	<description><![CDATA[<p>Hi there,</p>
</p>
<p>I am trying to determine if this is even possible. Been agonizing over this for hours. I have a custom formatter as follows:</p>
</p>
<p>function linkFormatter(cellvalue, options, rowObject)<br />{<br />&#160;&#160;&#160; if (cellvalue != "") {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // index of rowObject array is hard coded, keep in mind when column positions change<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; newUrl = "&#60;a href=&#39;dispform.aspx?ID="+rowObject[29]+"&#39; target=_blank&#62;"+cellvalue+"&#60;/a&#62;";<br />&#160;&#160;&#160; } else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; newUrl = "&#38;nbsp;";<br />&#160;&#160;&#160; }<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; return newUrl;<br />}</p>
</p>
<p>Basically, I don&#39;t want to keep having to reference an index for the columns, because I&#39;m frequently being asked to change column orders and I sometimes forget to update the custom formatters and it really messes things up. Is there anyway I can use either rowObject or some other method like getCell to access a given column?</p>
</p>
<p>I&#39;ve tried this and it always returns false, I have no idea what false even means.</p>
</p>
<p>var rowInfo = $("#backlog").jqGrid(&#39;getCell&#39;, options.rowId, &#39;Title&#39;);<br />&#160;&#160; &#160;<br />alert(rowInfo);</p>
</p>
<p>Is what I&#39;m trying to do even possible?</p>
]]></description>
        	        	<pubDate>Fri, 17 Sep 2010 06:24:21 +0300</pubDate>
        </item>
</channel>
</rss>