<?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: getting select box to rebuild after reloadgrid.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/getting-select-box-to-rebuild-after-reloadgrid</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/getting-select-box-to-rebuild-after-reloadgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>nelsonm on getting select box to rebuild after reloadgrid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getting-select-box-to-rebuild-after-reloadgrid#p25803</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getting-select-box-to-rebuild-after-reloadgrid#p25803</guid>
        	        	<description><![CDATA[<p>Never mind, i figured it out&#8230;</p>
<p>I added an &#39;afterSubmit&#39; event to the edit form of the state grid to test for and insert/remove the necessary select option from the work order add form&#39;s state select box.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8938' value='Select Code' data-codeid='sfcode8938' /></p>
<div class='sfcode' id='sfcode8938'>
<p>// state table grid</p>
<p>, afterSubmit: updateStateSelect}, // edit options.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>// javascript event.</p>
<p>&#160;&#160;&#160; // define handler function for &#39;afterSubmit&#39; event.<br />&#160;&#160; &#160;var updateStateSelect = function(response,postdata){<br />&#160;&#160; &#160;&#160;&#160; &#160;var json&#160;&#160;&#160;&#160;&#160; = response.responseText; // responseText is returned form server as json object:{status:true,message:&#39;&#39;}.<br />&#160;&#160; &#160;&#160;&#160; &#160;var result&#160;&#160;&#160; = JSON.parse(json); // convert json object into javascript object.</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;var rowid&#160;&#160;&#160;&#160; = $(&#39;#slt1-grid&#39;).getGridParam(&#39;selrow&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;var active&#160;&#160;&#160; = $(&#39;input#us\.StateActive&#39;).attr(&#39;checked&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;var stid&#160;&#160;&#160;&#160;&#160; = $(&#39;#slt1-grid&#39;).jqGrid(&#39;getCell&#39;, rowid, &#39;id&#39;); // get the option value.<br />&#160;&#160; &#160;&#160;&#160; &#160;var statename = $(&#39;#slt1-grid&#39;).jqGrid(&#39;getCell&#39;, rowid, &#39;us.StateName&#39;); // get the option label.</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;if(active){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if($(&#39;select#cu\.STID&#160; option[value=&#34;&#39;+stid+&#39;&#34;]&#39;).length == 0){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;select#cu\.STID&#39;).append(&#39;&#60;option value=&#34;&#39;+stid+&#39;&#34;&#62;&#39;+statename+&#39;&#60;/option&#62;&#39;); // append active option.<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;}else{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if($(&#39;select#cu\.STID&#160; option[value=&#34;&#39;+stid+&#39;&#34;]&#39;).length &#62; 0){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;select#cu\.STID option[value=&#34;&#39;+stid+&#39;&#34;]&#39;).remove(); // remove option if it exists.<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;}</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;return [result.status,result.message,result.newid];<br />&#160;&#160; &#160;}</p>
</div>
]]></description>
        	        	<pubDate>Thu, 26 Jan 2012 09:24:00 +0200</pubDate>
        </item>
        <item>
        	<title>nelsonm on getting select box to rebuild after reloadgrid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getting-select-box-to-rebuild-after-reloadgrid#p25801</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getting-select-box-to-rebuild-after-reloadgrid#p25801</guid>
        	        	<description><![CDATA[<p>hi,</p>
<p>how can i get an existing select box to rebuild in one grid after i update the table it uses in another grid?</p>
<p>i have a select box in one editform with options for only those states that the client operates in.&#160; If the client goes to the administrative state grid to enable another operating state - then goes back to the editform of the first grid and clicks on the select box to view the operating states, the new operating state should be included in the select box list.&#160; It doesn&#39;t appear in the list because the select box has not been reloaded.</p>
<p>I tried triggering a reload of the first grid when the state grid is updated but the select box in the first grid does not reload along with the grid reload.</p>
<p>How can i get the select box to rebuild or should i be using another method?</p>
</p>
<p>thanks.</p>
]]></description>
        	        	<pubDate>Thu, 26 Jan 2012 00:41:34 +0200</pubDate>
        </item>
</channel>
</rss>