<?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: Get Select field options in dependence of a second select field</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field</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/get-select-field-options-in-dependence-of-a-second-select-field/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>kramoo6 on Get Select field options in dependence of a second select field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field#p25134</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field#p25134</guid>
        	        	<description><![CDATA[<p>Ohh sorry!!</p>
<p>In the variable sv it gets from the cell was a space at the end of the string.</p>
<p>Know it works !</p>
]]></description>
        	        	<pubDate>Fri, 11 Nov 2011 18:10:36 +0200</pubDate>
        </item>
        <item>
        	<title>kramoo6 on Get Select field options in dependence of a second select field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field#p25133</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field#p25133</guid>
        	        	<description><![CDATA[<p>Ok it works.</p>
<p>I only have one probleme.</p>
<p>If i edit a row in the form it shows me the right value of the first select field but the wrong value of the second depended select field.</p>
<p>In the second select field it use the first &#60;option&#62; entry.</p>
<p>If i use the buttons next i get the next row and the right value for the second select field.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9840' value='Select Code' data-codeid='sfcode9840' /></p>
<div class='sfcode' id='sfcode9840'>
<p>colModel :[</p>
<p>{name:&#39;projektname&#39;, index:&#39;projektname&#39;, width:160, sorttype:&#34;string&#34;, edittype:&#34;select&#34;,&#160; editoptions:{&#34;value&#34;:selectfeldProjektname[&#39;responseText&#39;],&#34;separator&#34;:&#34;:&#34;}, editable:true },</p>
<p>{name:&#39;unterprojektname&#39;, index:&#39;unterprojektname&#39;, width:160, sorttype:&#34;string&#34;,edittype:&#34;select&#34;,editoptions:{&#34;value&#34;:&#34; :select&#34;},editable:true},</p>
<p>&#8230;.</p>
</p>
<p>&#34;beforeShowForm&#34;:function(formid)<br />&#160;&#160;&#160; {<br />&#160; // get the value of the country<br />&#160;&#160; &#160;var cntryval = $(&#34;#projektname&#34;,formid).val();<br />&#160;&#160; &#160;jQuery(&#34;#unterprojektname&#34;,formid).html(&#34;&#60;option&#62;Select&#60;/option&#62;&#34;);<br />&#160;&#160; &#160;if(cntryval) {<br />&#160;&#160; &#160;&#160; // if the value is found try to use ajax call to obtain the citys<br />&#160;&#160; &#160;&#160;&#160; &#160;// please look at file file city.php<br />&#160;&#160; &#160;&#160;&#160; &#160;jQuery.ajax({<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;url: &#39;/backlink/get-unterprojektname&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;dataType: &#39;html&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;//async: false,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;data: {q:cntryval},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;success : function(response)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sv=&#34;&#34;;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var sr = jQuery(&#34;#list&#34;).jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;console.log (sr);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if(sr)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; // get the selected city from grid<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sv = jQuery(&#34;#list&#34;).jqGrid(&#39;getCell&#39;,sr,&#39;unterprojektname&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;// empty the select and put the new selection<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#34;#unterprojektname&#34;,formid).html(&#34;&#34;).append(response);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if(sv)<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;console.log (sv);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; // select the city value<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#34;#unterprojektname&#34;,formid).val(sv).removeAttr(&#34;disabled&#34;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<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;});<br />&#160;&#160; &#160;} else {<br />&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#34;#unterprojektname&#34;,formid).attr(&#34;disabled&#34;,&#34;disabled&#34;);<br />&#160;&#160; &#160;} <br />&#160;&#160; &#160;},</p>
</div>
<p>console.log (sr) = 4</p>
<p>console.log (sv) = <span style="color: #ff0000;"><strong>oekostrom</strong></span></p>
<p>request from url: &#39;/backlink/get-unterprojektname&#39; = &#60;option value=&#39;stromrechner-vergleich&#39;&#62;stromrechner-vergleich&#60;/option&#62;<br />&#60;option value=&#39;oekostrom&#39;&#62;<span style="color: #ff0000;"><strong>oekostrom</strong></span>&#60;/option&#62;&#8230;.</p>
</p>
<p>Html from second select field:</p>
<p>&#60;select role="select" id="unterprojektname" name="unterprojektname" size="1&#8243; class="FormElement"&#62;<br />&#60;option value="stromrechner-vergleich"&#62;stromrechner-vergleich&#60;/option&#62;<br />&#60;option value="oekostrom"&#62;oekostrom&#60;/option&#62;<br />&#8230;.<br />&#60;/select&#62;</p>
</p>
<p>What can be wrong??</p>
]]></description>
        	        	<pubDate>Fri, 11 Nov 2011 17:54:38 +0200</pubDate>
        </item>
        <item>
        	<title>kramoo6 on Get Select field options in dependence of a second select field</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field#p25110</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/get-select-field-options-in-dependence-of-a-second-select-field#p25110</guid>
        	        	<description><![CDATA[<p>Hallo,</p>
<p>i use dataUrl to get the html for the select field from the DB.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9652' value='Select Code' data-codeid='sfcode9652' /></p>
<div class='sfcode' id='sfcode9652'>colModel :[ <br />&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;projektname&#39;, index:&#39;projektname&#39;, width:160,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#34;select&#34;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:&#39;/backlink/get-projektname&#39;} //, defaultValue:&#39;Intime&#39;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;//formoptions:{ rowpos:3,elmprefix:&#34;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#34; }<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;},</div>
<p>now i have a second select field. This should get the html for the field from DB in dependence from the first one.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1212' value='Select Code' data-codeid='sfcode1212' /></p>
<div class='sfcode' id='sfcode1212'>{name:&#39;unterprojektname&#39;, index:&#39;unterprojektname&#39;, width:160,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:&#34;select&#34;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:{dataUrl:&#39;/backlink/get-unterprojektname?selectfieldone=value&#39;} //, defaultValue:&#39;Intime&#39;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;},</div>
<p>How can I get the value of the first select field to the dataUrl of the second select field? Or is there another way?</p>
<p>Thanks.</p></p>
]]></description>
        	        	<pubDate>Thu, 10 Nov 2011 12:17:05 +0200</pubDate>
        </item>
</channel>
</rss>