<?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: Conditional select column contents</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/conditional-select-column-contents</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/conditional-select-column-contents/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Conditional select column contents</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/conditional-select-column-contents#p16183</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/conditional-select-column-contents#p16183</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I&#39;m not sure if this will solve the problem, but editoptions value can be defined as function</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#editoptions" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....ditoptions</a></p>
</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 03 Apr 2010 13:35:55 +0300</pubDate>
        </item>
        <item>
        	<title>Pete on Conditional select column contents</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/conditional-select-column-contents#p16030</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/conditional-select-column-contents#p16030</guid>
        	        	<description><![CDATA[<p>When I construct the page that hold my grids, I load all of the select values into global variables to reduce the number of round trips to the server the application has to make.&#160; When I have an inline edit with a conditional select (where the contents of another select will change based on what is chosen in a select column) I simply swap the HTML attribute of the conditional select with select values I want.&#160; This has worked great for several months.</p>
<p>But there is a problem with this approach because when the grid populates the select value of the editoptions, I can only designate one global variable in the editoptions e.g. editoptions: colLocations.&#160; Since I swap the value of colLocations when onChange is fired on the column, colLocations might have values 1,2,3,4 initially and then have values A,B,C,D later after the swap.&#160;</p>
<p>So the problem is that colLocations needs to change based on the value the grid loads in another column.&#160; What actually happens is that the column ends up with blanks when the grid loads because the value isn&#39;t present in the colLocations which is statically filled when the page loads. One workaround I tried was to put all possible select values into the column select, but then the column values aren&#39;t valid for certain combinations of columns. I&#39;d rather load the select values dynamically as each row loads in the grid.</p>
<p>So the question is, when you want select values to be conditional on a column as the grid *loads*, what is the best approach?&#160; Since I already have all the values I need loaded into global variables in the javascript, the optimal solution would be able to call a javascript function to load the correct select values based on value of the column as each row is constructed but I haven&#39;t found an event to capture that would allow me to do this.&#160; I took a look at dataEvents but I am not sure if that would work.</p>
<p>Any suggestions?&#160; Thanks,</p>
<p>Pete</p>
]]></description>
        	        	<pubDate>Mon, 29 Mar 2010 22:46:44 +0300</pubDate>
        </item>
</channel>
</rss>