<?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: how to dynamically set the choices in dropdownlist</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-dynamically-set-the-choices-in-dropdownlist</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/how-to-dynamically-set-the-choices-in-dropdownlist/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Renso on how to dynamically set the choices in dropdownlist</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-dynamically-set-the-choices-in-dropdownlist#p9014</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-dynamically-set-the-choices-in-dropdownlist#p9014</guid>
        	        	<description><![CDATA[<p>In this example I am loading the list of contacts when the grid is defined dynamically by using an Ajax request to fetch a Json string of key-value pairs that is formatted like this:</p>
<div class="netInfoResponseText netInfoText ">
<p><input type='button' class='sfcodeselect' name='sfselectit9785' value='Select Code' data-codeid='sfcode9785' /></p>
<div class='sfcode' id='sfcode9785'><code>27619:Renso Hollhumer;41:Annette Roulette;27546:Christopher Hollhumer;</code><code>27625:Tom</code><code> Adams</code></div>
<pre><code></code></pre>
</div>
<p><input type='button' class='sfcodeselect' name='sfselectit2426' value='Select Code' data-codeid='sfcode2426' /></p>
<div class='sfcode' id='sfcode2426'>
<p>&#160; var <span style="color: #ff0000;">allContacts</span> = $.ajax({ url: $(&#39;#ajaxListAllAccountContactNamesUrl&#39;).val() + &#39;/&#39; + $(&#39;fieldset#AccountDetails #Id&#39;).val(), <strong>async: false</strong>, success: function(data, result) { if (!result) alert(&#39;Failure to retrieve the Contacts.&#39;); } }).responseText;</p>
</p>
<p>&#160;&#160;&#160; $(&#39;#list&#39;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; .jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: listURL,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; postData: ajaxData,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; async: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#8220;json&#8221;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Id&#39;, &#39;Contact&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Id&#39;, index: &#39;&#39;, hidden: true, hidedlg: true },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Contact&#39;, index: &#39;Contact&#39;, edittype: "select", editoptions: { value: <span style="color: #ff0000;">allContacts </span>} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],</p>
</div>
<p><span style="color: #ff0000;">Very important, tjhe ajax call to get in this example the contacts must be set to async: <strong>false </strong>otherwise the grid will render before the data is returned and nt data will show up on your select.</span></p>
<p>Later, if after the grid gas been rendered you want to change the selection of the SELECT, use the editOptions property via the setColProp on the loadComplete event or other external event to set the contacts:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1925' value='Select Code' data-codeid='sfcode1925' /></p>
<div class='sfcode' id='sfcode1925'>$(&#39;#list&#39;).setColProp(&#39;Contact&#39;, {editOptions: {value: newListOfContacts} });</div>
]]></description>
        	        	<pubDate>Fri, 28 Aug 2009 08:02:31 +0300</pubDate>
        </item>
        <item>
        	<title>LonelyRonaldinho on how to dynamically set the choices in dropdownlist</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-dynamically-set-the-choices-in-dropdownlist#p9007</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-dynamically-set-the-choices-in-dropdownlist#p9007</guid>
        	        	<description><![CDATA[<p>hi, how to dynamically change the options in dropdownlist ?</p>
<p>by json string ?</p></p>
]]></description>
        	        	<pubDate>Fri, 28 Aug 2009 03:22:28 +0300</pubDate>
        </item>
</channel>
</rss>