<?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 Formatter Parameters</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1</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-formatter-parameters-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Copperhead89 on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p27382</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p27382</guid>
        	        	<description><![CDATA[<blockquote>
<p>OlegK said:</p>
<p>Hello Cas,</p>
<p><a href="/jqgridwiki/doku.php?id=wiki:custom_formatter" target="_blank">custom formatter</a> is a callback function, like <a href="http://msdn.microsoft.com/en-us/library/ms633573(VS.85).aspx" target="_blank">WindowProc</a> for example. So jqGrid will call it and will <strong>not know</strong>&#160;in what calls which value of iColNum should be used. In general the parameters of all callback functions define the caller, so by jqGrid or by Windows, and <em>you</em> should implement the function with the defined parameters if you want to use the feature and not vice versa. Like Microsoft will not rewrite Windows Code for one&#160;customer, jqGrid code can not be&#160;rewritten&#160;for every user. Moreover, like I described at the beginning of my email, jqGrid can not know which value of the additional parameter could be used at the different calls.</p>
<p>If you want to define the function with additional parameter like</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4618' value='Select Code' data-codeid='sfcode4618' /></p>
<div class='sfcode' id='sfcode4618'>ProjectLink_formatter = function (cellvalue, options, rowObject,<strong>iColNum</strong>){...}</div>
<p>you can call it yourself from the custom formatter function of every column where it need be used:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3643' value='Select Code' data-codeid='sfcode3643' /></p>
<div class='sfcode' id='sfcode3643'>{name:&#39;FirstColumn&#39;, formatter: function (cellvalue, options, rowObject) { return &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;ProjectLink_formatter(cellvalue, options, rowObject,6);}},<br /> {name:&#39;SecondColumn&#39;, formatter: function (cellvalue, options, rowObject) { return &#160;ProjectLink_formatter(cellvalue, options, rowObject,3);}}</div>
<p>and so on. So you should call yourself the function which you define.</p>
<p>Best regards<br />Oleg&#160;</p>
</blockquote>
<hr />
<p>Oh my god, it&#39;s worked, thanks you so much</p>
]]></description>
        	        	<pubDate>Tue, 25 Sep 2012 08:00:25 +0300</pubDate>
        </item>
        <item>
        	<title>casperd on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21274</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21274</guid>
        	        	<description><![CDATA[<p>Hi Oleg,</p>
</p>
<p>You&#39;re the man!! This sorted it out.</p>
</p>
<p>Thanks!</p>
<p>Cas</p>
]]></description>
        	        	<pubDate>Tue, 14 Dec 2010 13:52:21 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21273</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21273</guid>
        	        	<description><![CDATA[<p>Hello Cas,</p>
<p><a href="/jqgridwiki/doku.php?id=wiki:custom_formatter" target="_blank">custom formatter</a> is a callback function, like <a href="http://msdn.microsoft.com/en-us/library/ms633573(VS.85).aspx" target="_blank">WindowProc</a> for example. So jqGrid will call it and will <strong>not know</strong>&#160;in what calls which value of iColNum should be used. In general the parameters of all callback functions define the caller, so by jqGrid or by Windows, and <em>you</em> should implement the function with the defined parameters if you want to use the feature and not vice versa. Like Microsoft will not rewrite Windows Code for one&#160;customer, jqGrid code can not be&#160;rewritten&#160;for every user. Moreover, like I described at the beginning of my email, jqGrid can not know which value of the additional parameter could be used at the different calls.</p>
<p>If you want to define the function with additional parameter like</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3258' value='Select Code' data-codeid='sfcode3258' /></p>
<div class='sfcode' id='sfcode3258'>ProjectLink_formatter = function (cellvalue, options, rowObject,<strong>iColNum</strong>){...}</div>
<p>you can call it yourself from the custom formatter function of every column where it need be used:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3940' value='Select Code' data-codeid='sfcode3940' /></p>
<div class='sfcode' id='sfcode3940'>{name:&#39;FirstColumn&#39;, formatter: function (cellvalue, options, rowObject) { return &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;ProjectLink_formatter(cellvalue, options, rowObject,6);}},<br /> {name:&#39;SecondColumn&#39;, formatter: function (cellvalue, options, rowObject) { return &#160;ProjectLink_formatter(cellvalue, options, rowObject,3);}}</div>
<p>and so on. So you should call yourself the function which you define.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 14 Dec 2010 13:34:20 +0200</pubDate>
        </item>
        <item>
        	<title>casperd on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21271</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21271</guid>
        	        	<description><![CDATA[<p>Hi Oleg,</p>
</p>
<p>Here is my current formatter function:</p>
</p>
<p>ProjectLink_formatter = function (cellvalue, options, rowObject){<br />&#160;&#160; &#160;&#160;&#160;&#160; return "&#60;a href=&#39;" + rowObject.childNodes[6].textContent + "&#39; target=_new title=&#39;Click to navigate to the Project Workspace&#39;&#62;" + cellvalue + "&#60;/a&#62;";<br />}</p>
</p>
<p>Now, I would like to replace the hardcoded "6" in the function above with a variable parameter, so that I can use any value. Something like this:</p>
<p>ProjectLink_formatter = function (cellvalue, options, rowObject,<span style="color: #ff0000;"><strong>iColNum</strong></span>){<br /> &#160;&#160; &#160;&#160;&#160;&#160; return "&#60;a href=&#39;" + rowObject.childNodes[<span style="color: #ff0000;"><strong>iColNum</strong></span>].textContent + "&#39;  target=_new title=&#39;Click to navigate to the Project Workspace&#39;&#62;" +  cellvalue + "&#60;/a&#62;";<br /> }</p>
</p>
<p>What are the best options?</p>
</p>
<p>Thanks,</p>
<p>Cas</p>
]]></description>
        	        	<pubDate>Tue, 14 Dec 2010 12:47:37 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21073</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21073</guid>
        	        	<description><![CDATA[<p>Hello casperd,</p>
<p>if you post the code example with your custom formatter and explain what which information you want to have additionally in the custom formatter one could explain all more clear.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Thu, 02 Dec 2010 13:09:41 +0200</pubDate>
        </item>
        <item>
        	<title>casperd on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21070</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21070</guid>
        	        	<description><![CDATA[<p>Thanks for the reply. But, I still don;t understand how that will fit into a Custom Formatter function?</p>
]]></description>
        	        	<pubDate>Thu, 02 Dec 2010 06:23:10 +0200</pubDate>
        </item>
        <item>
        	<title>tucano on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21046</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21046</guid>
        	        	<description><![CDATA[<p>n&#227;o sei se entendi perfeitamente a sua pergunta, mas me tento a responder.</p>
</p>
<p>se for algo desse tipo</p>
<p>{myColun: myFunction(param1,param2)}</p>
<p>para o addRowData, funciona sim</p>
</p>
<p>at&#233; mais!</p>
<p><img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /></p>
]]></description>
        	        	<pubDate>Tue, 30 Nov 2010 21:32:54 +0200</pubDate>
        </item>
        <item>
        	<title>casperd on Custom Formatter Parameters</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21029</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-parameters-1#p21029</guid>
        	        	<description><![CDATA[<div id="post21000">
<p>Hi,</p>
</p>
<p>Is it possible to send additional parameters to a custom formatter function?</p>
</p>
<p>Thanks,</p>
<p>Cas</p>
</div>
]]></description>
        	        	<pubDate>Mon, 29 Nov 2010 07:10:40 +0200</pubDate>
        </item>
</channel>
</rss>