<?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: Combobox dynamic in a subgrid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid</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/combobox-dynamic-in-a-subgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>pequesalta on Combobox dynamic in a subgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3638</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3638</guid>
        	        	<description><![CDATA[<p>Hi! Tony.</p>
<p>I tested with beforeShowForm. That&#39;s ok.</p>
<p>You&#39;re great.</p>
<p>Thanks for all. Regards.</p></p>
]]></description>
        	        	<pubDate>Mon, 22 Dec 2008 00:06:42 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Combobox dynamic in a subgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3618</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3618</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>If every time you want to populate the select when the form is open (i.e. if every time&#160; click on add or edit buttons) I think that beforeShowForm is the right event for you.</p>
<p>onInitializeForm is called only once when the form is created, but beforeShowForm every time we click on one of these buttons.</p>
<p>Define in colModel select with emty values</p>
<p>{ name: "myselect", edittype: "select", editoptions:{" : "}...}</p>
<p>then you can configure your server to return the html like this:</p>
<p>&#60;option value="1"&#62;One&#60;/option&#62;</p>
<p>....</p>
<p>The code:</p>
<p>beforeShowForm : function (formid) {</p>
<p>$.ajax({</p>
<p>....</p>
<p>success : function(response) {</p>
<p>$("#myselect",formid).empty().html(response.responseText);</p>
<p>}</p>
<p>...</p>
<p>});</p>
<p>}</p>
<p>If you want this to happen only once make this in onInitializeForm</p>
<p>Hope this helps</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 20 Dec 2008 03:03:30 +0200</pubDate>
        </item>
        <item>
        	<title>pequesalta on Combobox dynamic in a subgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3599</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3599</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>Every time because each student will be enrolled in differents subjects.</p>
<p>Regards.</p>
]]></description>
        	        	<pubDate>Thu, 18 Dec 2008 07:42:25 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Combobox dynamic in a subgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3595</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3595</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Do you want to populate the values only once or every time you open the form?</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 18 Dec 2008 06:48:12 +0200</pubDate>
        </item>
        <item>
        	<title>pequesalta on Combobox dynamic in a subgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3591</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/combobox-dynamic-in-a-subgrid#p3591</guid>
        	        	<description><![CDATA[<p>Hi to all !!</p>
<p>I&#39;m trying to make a select / combobox dynamic in a subgrid when click in add or edit button of navigation. The main grid contains student and the subgrid contains subject areas (physics, music, mathematical sciences, ....). A student can study one or more subjects, &#191;ok?</p>
<p>I&#39;m use the method&#160; &#39;onInitializeForm&#39; in subgrid.</p>
<p>This is the code:</p>
<p>.... // in add options</p>
<p>onInitializeForm: function (formid) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; type: "POST",</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url:&#39;dame_datos.php?nd=&#39;+new Date().getTime()+&#39;&#38;q=T&#38;idc=&#39;+row_id,&#160;</p>
<p>// I pass the student id for sql get me only the subjects which not study.</p>
<p>// in the sql result, i get this data:</p>
<pre>// {"rows":[["2","Music"],["3","Mathematical"]]}<br /><br />// because this student was registered in physical, &#191;ok?</pre>
<p>&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; datatype: "script",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; success: function(grupos){</p>
<p>// #asignaturas is the combobox <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#asignaturas&#39;,formid).append(&#39;&#60;option value="&#39; + <strong>&#191;what?</strong> + &#39;"&#62;&#39; + <strong>&#191;what?</strong> + &#39;&#60;/option&#62;&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; &#160;&#160;&#160; }</p>
<p>My problem: I&#39; can&#39;t / I don&#39;t know capture this values in the combobox.</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Thu, 18 Dec 2008 05:19:07 +0200</pubDate>
        </item>
</channel>
</rss>