<?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: 'Virtual' data mode</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode</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/virtual-data-mode/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29945</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29945</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Of course the way I posted this will not work. It was my mistake. Sorry.</p>
<p>The way to do it is to define a variable and change the variable within the function.</p>
</p>
<p>Here is a <a href="/blog/phpjqgrid/examples/tests/bosko/default.php" target="_blank">example</a></p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 09 Dec 2013 11:55:51 +0200</pubDate>
        </item>
        <item>
        	<title>bosko on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29943</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29943</guid>
        	        	<description><![CDATA[<p>Of course. I didn&#39;t try to do that. I just tried to use function for name through variable as you suggested but result is the same - sort will not work in that case.</p>
]]></description>
        	        	<pubDate>Mon, 09 Dec 2013 11:11:04 +0200</pubDate>
        </item>
        <item>
        	<title>tony on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29942</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29942</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>I will say it other way- the names in colModel can not be changed dynamically.</p>
<p>With other words if you want to change the name by condition you will need to unload and load the grid again with the new name in colModel.</p>
</p>
<p>See docs for methods how unload the grid.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 09 Dec 2013 11:04:33 +0200</pubDate>
        </item>
        <item>
        	<title>bosko on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29941</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29941</guid>
        	        	<description><![CDATA[<p>I agree with you that simple solutions are the best one in most cases but unfortunatelly it seems this is not the case here. This solution also cross my mind and I tried it but with same result.</p>
<p>Looks like grid cannot work in &#39;virtual mode&#39;. Problem is in a way header cell is constructed. Namely for element id it uses &#39;name&#39; value from colModel which returns function code even if it is used in proposed way.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7392' value='Select Code' data-codeid='sfcode7392' /></p>
<div class='sfcode' id='sfcode7392'>&#60;th id=&#39;&#34;+ts.p.id+&#34;_&#34;+ts.p.colModel[i].name....</div>
</p>
<p>Best regards,</p>
<p>Bosko</p>
]]></description>
        	        	<pubDate>Mon, 09 Dec 2013 10:47:27 +0200</pubDate>
        </item>
        <item>
        	<title>tony on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29940</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29940</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Looking into the code I see there are some things which cause this not to work.</p>
<p>In most cases simple solutions are best one.</p>
<p>You can</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4551' value='Select Code' data-codeid='sfcode4551' /></p>
<div class='sfcode' id='sfcode4551'>
<p>var myname = myNameFunction(obj);</p>
<p>&#8230;</p>
</p>
<p>..jqGrid({</p>
<p>&#8230;</p>
<p>colModel : [</p>
<p>...</p>
<p>{ name : myname ,....},</p>
<p>...</p>
<p>],</p>
<p>&#8230;</p>
<p>});</p>
</div>
<p>where myNameFunction is the function defined from your post in colModel</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Sat, 07 Dec 2013 12:29:10 +0200</pubDate>
        </item>
        <item>
        	<title>bosko on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29939</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29939</guid>
        	        	<description><![CDATA[<blockquote>
<p>Hello,</p>
</blockquote>
<blockquote>
<p>I thought also that index property might help but it didn&#39;t. Seems like problem (at least for sorting) is in fact that when function is used for column name column id is set to source of function (actually substring of it). Later on in click handler there is comparision:</p>
</blockquote>
<blockquote>
<p>this.name === tid</p>
</blockquote>
<blockquote>
<p>which compares name (function in this case) and id which is string equal to substring of function source. Reproducing this is easy. Just in any sample put name to be function. Part of my code is:</p>
</blockquote>
<blockquote>
</blockquote>
<blockquote>
<p>colModel: [</p>
<p>{ name: function(obj) {</p>
<p>if (total) {</p>
<p>return obj.values.weight;</p>
<p>} else {</p>
<p>return obj.values.weight * totalNumber;</p>
<p>}</p>
<p>}, index: "calories", label: "Weight", width: 78, align: "right", firstsortorder: &#39;desc&#39;, sorttype: "float" }</p>
<p>]</p>
</p>
<p>Best regards,</p>
<p>Bosko</p>
</p>
</blockquote>
]]></description>
        	        	<pubDate>Fri, 06 Dec 2013 17:32:31 +0200</pubDate>
        </item>
        <item>
        	<title>tony on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29938</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29938</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>A simple source code will be greatly appretiated, we can not help in most cases if no test case is provided.</p>
<p>I&#39;m not sure if this can work, but maybe you will need to set a index property of this column in colModel.</p>
<p>See docs</p>
</p>
<p>Kind Regards</p></p>
]]></description>
        	        	<pubDate>Fri, 06 Dec 2013 16:36:44 +0200</pubDate>
        </item>
        <item>
        	<title>bosko on 'Virtual' data mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29937</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/virtual-data-mode#p29937</guid>
        	        	<description><![CDATA[<p>I&#39;m using jqGrid with local data and values that should be displayed in the cells depend on couple flags that can be set on the page. Simple example would be column called &#39;weight&#39; which displays unit weight but if &#39;Total value&#39; check box is checked on the page than in value displayed in this cell should be calculated value base on several other parameters (i.e. num_items * weight). I managed to do this by setting &#39;name&#39; option in colModel to function which returns either row or calculated value. However in this case sorting by that column is not working.</p>
</p>
<p>Is there any way I can use jqGrid in this &#39;virtual data&#39; mode where for each column instead of direct mapping to data custom function can be used?</p>
</p>
<p>Regards,</p>
<p>Bosko</p>
]]></description>
        	        	<pubDate>Fri, 06 Dec 2013 13:40:23 +0200</pubDate>
        </item>
</channel>
</rss>