<?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: Dynamically Change Drop Down Item Text</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dynamically-change-drop-down-item-text</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/dynamically-change-drop-down-item-text/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>drumboog on Dynamically Change Drop Down Item Text</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamically-change-drop-down-item-text#p22479</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamically-change-drop-down-item-text#p22479</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I have a grid (form edit) with a select column. &#160;The formatter of the column is set to &#39;select&#39; and the column displays correctly when initially loaded...</p>
</p>
<pre>   jQuery(document).ready(
      function () {
         var selectOptions = &#39;1:Test 1;2:Test 2;3:Test 3&#39;;

         $(&#39;#grid&#39;).jqGrid(
         {
            loadui: &#39;disable&#39;,
            height: &#39;100%&#39;,
            colNames: [&#39;&#39;, &#39;ID&#39;, &#39;Test&#39;],
            colModel: [
               { name: &#39;EditLink&#39;, index: &#39;EditLink&#39;, formatter: editLinkFormatter, width: 50 },
               { name: &#39;ID&#39;, index: &#39;ID&#39;, key: true, editable: true, width: 50, edittype: &#39;select&#39;, formatter: &#39;select&#39;, editoptions: { value: selectOptions } },
               { name: &#39;Test&#39;, index: &#39;Test&#39;, editable: true, width: 300 },
             ],
          });

          $(&#39;#grid&#39;).addRowData(1, { ID: 1, Test: &#39;Test Value&#39; });
          $(&#39;#grid&#39;).addRowData(2, { ID: 2, Test: &#39;Test Value&#39; });
          $(&#39;#grid&#39;).addRowData(3, { ID: 3, Test: &#39;Test Value&#39; });
       }
    );</pre>
</p>
<p>I need to dynamically update the text for the dropdown list...</p>
<pre>   var selectOptions = &#39;1:Test Change 1;2:Test Change 2;3:Test Change 3&#39;;
   $(&#39;#grid&#39;).setColProp(&#39;ID&#39;, { editoptions: { value: selectOptions} });
</pre>
</p>
<p>The ids for the select list will stay the same, but the text needs to be updated. &#160;If I remove the formatter from the column, the drop down list is updated on the edit form as expected.</p>
<p>However, when the formatter is set to &#39;select&#39;, the text in the ID column is not updated and the selected values are not persisted when the edit form is opened.</p>
<p>Is there something in the &#39;select&#39; formatter that causes problems with this?</p>
<p>I&#39;ve tried calling&#160;<span style="white-space: pre;">$(&#39;#grid&#39;).<span style="white-space: normal;">trigger(&#39;reloadGrid&#39;) to force the grid to update, but this does not have any affect.</span></span></p>
<p><span style="white-space: pre;"><span style="white-space: normal;">Is there a way to force this column to refresh and reload the editoptions?</span></span></p>
<p>Thanks,</p>
<p>Glen</p></p>
]]></description>
        	        	<pubDate>Sun, 20 Mar 2011 07:51:45 +0200</pubDate>
        </item>
</channel>
</rss>