<?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: Select Populated from DB</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db</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/select-populated-from-db/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>miknight on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p8005</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p8005</guid>
        	        	<description><![CDATA[<p>I have a similar requirement but I need the contents of the select box to be different depending on the record being edited.</p>
<p>I tried calling</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7800' value='Select Code' data-codeid='sfcode7800' /></p>
<div class='sfcode' id='sfcode7800'>jQuery(grid).setColProp(&#39;link_to&#39;, {editoptions: {value: new_opts}});</div>
<p>before firing</p>
<p><input type='button' class='sfcodeselect' name='sfselectit488' value='Select Code' data-codeid='sfcode488' /></p>
<div class='sfcode' id='sfcode488'>jQuery(grid).editGridRow(&#8230;)</div>
<p>However, this only worked for the first call. Subsequent calls for other records would not change it.</p>
<p>I tried editing the SetColProp() function to make the extend a deep copy:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9846' value='Select Code' data-codeid='sfcode9846' /></p>
<div class='sfcode' id='sfcode9846'>$.extend(true, this.p.colModel[i],obj);</div>
<p>but this still didn&#39;t fix the problem.</p>
</p>
<p><strong>Edit:</strong> I was able to fix this by adding</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7702' value='Select Code' data-codeid='sfcode7702' /></p>
<div class='sfcode' id='sfcode7702'>recreateForm: true</div>
<p>to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5076' value='Select Code' data-codeid='sfcode5076' /></p>
<div class='sfcode' id='sfcode5076'>jQuery(grid).editGridRow(&#8230;)</div>
]]></description>
        	        	<pubDate>Thu, 23 Jul 2009 23:53:45 +0300</pubDate>
        </item>
        <item>
        	<title>Renso on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7626</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7626</guid>
        	        	<description><![CDATA[<p>Answering my own post, 3.5 Beta, I am not there yet.</p>
]]></description>
        	        	<pubDate>Thu, 02 Jul 2009 07:43:42 +0300</pubDate>
        </item>
        <item>
        	<title>Renso on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7625</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7625</guid>
        	        	<description><![CDATA[<p>dataUrl? What version of jqGrid, and examples?</p>
]]></description>
        	        	<pubDate>Thu, 02 Jul 2009 07:38:38 +0300</pubDate>
        </item>
        <item>
        	<title>casperd on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7616</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7616</guid>
        	        	<description><![CDATA[<p>Yeah, I used dataUrl, and it works 100%!</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Thu, 02 Jul 2009 04:54:19 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7609</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7609</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks Renso.</p>
<p>Also the new option dataUrl can be used too - which I recommend.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 02 Jul 2009 03:34:09 +0300</pubDate>
        </item>
        <item>
        	<title>Renso on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7580</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7580</guid>
        	        	<description><![CDATA[<div id="post3095">
<p>Quite simply actually, I do it with all my selectables:</p>
<p>Do this before you define the jqGrid and make sure <strong>async is set to false</strong>. If you do not set it to false, the grid will completely render before the data has retuened and the drop down box wil be empty.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1878' value='Select Code' data-codeid='sfcode1878' /></p>
<div class='sfcode' id='sfcode1878'>&#160;&#160;&#160; //get all products<br />&#160;&#160;&#160; var products = $.ajax({url: $(&#39;#ajaxAllProductsUrl&#39;).val(), <strong>async: false</strong>, success: function(data, result) {if (!result) alert(&#39;Failure to retrieve the Products.&#39;);}}).responseText;</div>
<p>The define your grid:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6734' value='Select Code' data-codeid='sfcode6734' /></p>
<div class='sfcode' id='sfcode6734'>&#160;&#160;&#160; $(item)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; .jqGrid({&#160;&#160; <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: {ContractId : $(&#39;fieldset#ContractDetails #ContractId&#39;).val()},<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;Product Name&#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;,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index:&#39;Id&#39;, sortable:true, editrules:{edithidden:false}}, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #ff0000;">{name:&#39;ProductName&#39;,&#160;&#160; index:&#39;ProductName&#39;, sortable:true, required:true, editable:true, edittype:"select", editoptions:{<strong>value:products</strong>}, editrules:{required:true}}</span>],</div>
<p>You can also do it on the loadComplete event by using setColProp, which I do in some other cases as if you are going to have modal boxes for editing it will generate a runtime error if you do not have it set the following way:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4459' value='Select Code' data-codeid='sfcode4459' /></p>
<div class='sfcode' id='sfcode4459'>
<p>loadComplete: function()&#160;&#160;&#160; {$(item).setColProp(&#39;ProductName&#39;,{editoptions:{<strong>value:products</strong>}});</p>
</div>
<p>By the way &#8220;item&#8221; is the id of the grid. Hope this helps</p>
</div>
]]></description>
        	        	<pubDate>Wed, 01 Jul 2009 16:43:17 +0300</pubDate>
        </item>
        <item>
        	<title>casperd on Select Populated from DB</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7577</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/select-populated-from-db#p7577</guid>
        	        	<description><![CDATA[<p>I need to have the selects in my grid to be populated from my databases. So, when the user clicks on the cell to edit, the select should have values from a lookup table in my database. Does anyone have an example like this?</p>
]]></description>
        	        	<pubDate>Wed, 01 Jul 2009 09:31:40 +0300</pubDate>
        </item>
</channel>
</rss>