<?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: editoptions + select from local array</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array</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/editoptions-select-from-local-array/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Romyn on editoptions + select from local array</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10160</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10160</guid>
        	        	<description><![CDATA[<p>Thanks.</p>
</p>
<p>I&#39;ve now managed to get the select&#39;s listing to work but have run into other problems now.</p>
</p>
<p>I initialise the relevant column in the grid with</p>
<p>{name:&#39;dbcourseid&#39;, index:&#39;dbcourseid&#39;, width:60, editable:true, edittype:&#39;select&#39;, align:&#39;left&#39;}</p>
</p>
<p>I then work out what the courselist should be - in this case</p>
<p>19:Blue;20:Orange;21:Green</p>
</p>
<p>I then set this as the source for the column using</p>
<p>$("#grid_rm").setColProp(&#39;dbcourseid&#39;,{editoptions:{value:courselist}});</p>
</p>
<p>I then load 2 rows using addRowData</p>
</p>
<p>The dbcourseid column for these 2 rows show the numbers rather than the colours. I&#39;ve tried with formatter:&#39;select&#39; but that doesn&#39;t seem to work either. (I&#39;m running an earlier version of 3.5 so upgraded to 3.5.3 but that causes other errors in other grids which I can&#39;t pin down)</p>
</p>
<p>However if I add another row using editGridRow("new") then the dropdown in that shows the colours and also stores the colour, rather than the number, in the grid.</p>
</p>
<p>I can&#39;t work out what I have to do to make the column behave like a standard foreign key column - ie ID Value where the ID is stored but the Value is displayed. I suspect this may be fixed, from reading other threads, on the latest version but I can&#39;t get 3.5.3 to work without errors elsewhere and when I skip over the bits that it errors on (other grids) it still doesn&#39;t do it - with or without the formatter option set.</p>
</p>
<p>Am I doing something fundementally wrong here?</p>
</p>
<p>Thanks again.</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Fri, 25 Sep 2009 12:00:51 +0300</pubDate>
        </item>
        <item>
        	<title>seantsm28 on editoptions + select from local array</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10106</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10106</guid>
        	        	<description><![CDATA[<p>To fit your example I should have used courselist for the variable name.</p>
<p>var courselist = &#8220;23:Course1;45:Course2&#8243;;</p>
]]></description>
        	        	<pubDate>Thu, 24 Sep 2009 23:35:59 +0300</pubDate>
        </item>
        <item>
        	<title>seantsm28 on editoptions + select from local array</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10105</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10105</guid>
        	        	<description><![CDATA[<p>What has worked for me has been using this pattern:</p>
<p>var coursevalues = "23:Course1;45:Course2";</p>
<p>(colons between key and value, semicolon separator between option pairs, quotes only at beginning and end of entire list)</p></p>
]]></description>
        	        	<pubDate>Thu, 24 Sep 2009 23:33:12 +0300</pubDate>
        </item>
        <item>
        	<title>MamaliFrenchi on editoptions + select from local array</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10104</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10104</guid>
        	        	<description><![CDATA[<p>editoptions:{value:courselist} courselist shouldbe as the follow:</p>
<p>&#60;select&#62;&#60;option value="23"&#62;Course1&#60;/option&#62;&#60;option value="45"&#62;Course2&#60;/option&#62;&#60;/select&#62;</p>
]]></description>
        	        	<pubDate>Thu, 24 Sep 2009 21:32:51 +0300</pubDate>
        </item>
        <item>
        	<title>Romyn on editoptions + select from local array</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10102</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editoptions-select-from-local-array#p10102</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Been struggling this for hours and after reading many threads connected with select and editoptions I know the answer is in here somewhere but unfortunately I&#39;m having difficulty digging it out - so I&#39;m hoping someone can put me out of my misery.</p>
</p>
<p>I have a grid (grid_rm) in which one of the columns (dbcourseid) contains the primary key from a database table. The column is set to edittype "select" and I want it to perform like a standard dropdown - see/select a text value but store an ID.</p>
</p>
<p>All my data is in local arrays so after I initialise the grid but before I load any data I put together the option list for this select - "courselist".</p>
<p>I then use the setColProp call to set this for the column:-</p>
<p>$("#grid_rm").setColProp(&#39;dbcourseid&#39;,{editoptions:{value:courselist}});</p>
</p>
<p>The problem is I can&#39;t seem to get the courselist to be in the right format to display as intended?</p>
</p>
<p>At the moment I have the data in an array - for example...</p>
</p>
<p>Course[0]&#160;&#160;&#160; ID=23&#160;&#160;&#160;&#160; Text="Course1"</p>
<p>Course[1]&#160;&#160;&#160; ID= 45&#160;&#160;&#160; Text="Course2"</p>
<p>etc (but can do it any way)</p>
</p>
<p>What I can&#39;t seem to do is to get it into the format {23:"Course1",45:"Course2} which I think is the correct way.</p>
</p>
<p>Any assistance to put me right would be greatly appreciated.</p>
</p>
<p>Thanks</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Thu, 24 Sep 2009 20:15:11 +0300</pubDate>
        </item>
</channel>
</rss>