<?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 swap grid definitions? </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-swap-grid-definitions</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-swap-grid-definitions/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tad on How to swap grid definitions? </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-swap-grid-definitions#p7810</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-swap-grid-definitions#p7810</guid>
        	        	<description><![CDATA[<p>I need to swap out between 2 grid definitions. My code below <span style="text-decoration: underline;">does</span> set the swapped "url" property, but does not change "caption", "colNames", "colModel" etc...</p>
<p>load_table() is fired with an onchange for the select input that chooses which grid definition is desired.</p>
<p>What am I doing wrong?</p>
<p>var grids = {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; one: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;Switch Test One&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;switch.cgi?q=1&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[&#39;id&#39;, &#39;One&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [{name: &#39;id&#39;}, {name: &#39;one&#39;}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;200px&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; imgpath: &#39;css/jqgrid/steel/images&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; two: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;Switch Test Two&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;switch.cgi?q=2&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[&#39;id&#39;, &#39;Two&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [{name: &#39;id&#39;}, {name: &#39;two&#39;}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;200px&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; imgpath: &#39;css/jqgrid/steel/images&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />};</p>
<p>jQuery(document).ready(function(){<br />&#160;&#160;&#160; jQuery("#switch_grid").jqGrid( grids[&#39;one&#39;] );<br />});</p>
<p>function load_table () {<br />&#160;&#160;&#160; var which = $(&#39;#switch&#39;).val(); // get value from select dropdown<br />&#160;&#160;&#160; jQuery("#switch_grid").setGridParam(grids[which]).trigger(&#39;reloadGrid&#39;);<br />}</p></p>
]]></description>
        	        	<pubDate>Tue, 14 Jul 2009 08:11:24 +0300</pubDate>
        </item>
</channel>
</rss>