<?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: Dynamic colModel</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel</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/dynamic-colmodel/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1619</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1619</guid>
        	        	<description><![CDATA[<p>Great,</p>
<p>Thanks. Also we can use&#160; GridUnload method and then create again the</p>
<p>grid with new colModel options</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 20 Aug 2008 08:46:53 +0300</pubDate>
        </item>
        <item>
        	<title>spacialk on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1615</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1615</guid>
        	        	<description><![CDATA[<p>Just one more adjustment for the colModel in the php end.</p>
<p>$test-&#62;colmodel = array(array(&#39;name&#39; =&#62; &#39;id&#39;, &#39;index&#39; =&#62; &#39;id&#39;, &#39;editable&#39; =&#62; false , &#39;editoptions&#39; =&#62; array(&#39;readonly&#39; =&#62; true,&#39;size&#39; =&#62; 10)),<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; array(&#39;name&#39; =&#62; &#39;role_id&#39;,&#160;&#160;&#160; &#160;&#160;&#160; &#39;index&#39; =&#62; &#39;role_id&#39;, &#160;&#160;&#160; &#39;editable&#39; =&#62; true,&#39;editoptions&#39; =&#62; array(&#39;size&#39; =&#62; 25)),<br />&#160;&#160;&#160; &#160;&#160;&#160; array(&#39;name&#39; =&#62; &#39;username&#39;,&#160;&#160;&#160; &#160;&#160;&#160; &#39;index&#39; =&#62; &#39;username&#39;, &#160;&#160;&#160; &#39;editable&#39; =&#62; true,&#39;editoptions&#39; =&#62; array(&#39;size&#39; =&#62; 25)),<br />&#160;&#160;&#160; &#160;&#160;&#160; array(&#39;name&#39; =&#62; &#39;password&#39;,&#160;&#160;&#160; &#160;&#160;&#160; &#39;index&#39; =&#62; &#39;password&#39;, &#160;&#160;&#160; &#39;editable&#39; =&#62; true,&#39;editoptions&#39; =&#62; array(&#39;size&#39; =&#62; 25)),<br />&#160;&#160;&#160; &#160;&#160;&#160; array(&#39;name&#39; =&#62; &#39;first_name&#39;,&#160;&#160;&#160; &#39;index&#39; =&#62; &#39;first_name&#39;,&#39;editable&#39; =&#62; true,&#39;editoptions&#39; =&#62; array(&#39;size&#39; =&#62; 25)),<br />&#160;&#160;&#160; &#160;&#160;&#160; array(&#39;name&#39; =&#62; &#39;last_name&#39;,&#160;&#160;&#160; &#39;index&#39; =&#62; &#39;last_name&#39;, &#39;editable&#39; =&#62; true,&#39;editoptions&#39; =&#62; array(&#39;size&#39; =&#62; 25)), <br />&#160;&#160;&#160; &#160;&#160;&#160; array(&#39;name&#39; =&#62; &#39;email&#39;,&#160;&#160;&#160; &#160;&#160;&#160; &#39;index&#39; =&#62; &#39;email&#39;, &#160;&#160;&#160; &#39;editable&#39; =&#62; true,&#39;editoptions&#39; =&#62; array(&#39;size&#39; =&#62; 25)));</p>
<p>This works fine.</p>
<p>Karel-Jan</p>
]]></description>
        	        	<pubDate>Wed, 20 Aug 2008 03:18:38 +0300</pubDate>
        </item>
        <item>
        	<title>spacialk on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1614</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1614</guid>
        	        	<description><![CDATA[<p>Ok I found a sollution. It wasn&#39;t that difficult and just to let you all know it does work.</p>
<p>The php end:</p>
<p>function test(){&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; $test-&#62;colnames = array(&#39;Id&#39;,&#39;Rights&#39;, &#39;Username&#39;, &#39;Password&#39;, &#39;First Name&#39;, &#39;Last Name&#39;, &#39;E-Mail&#39;);<br />&#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; $test-&#62;colmodel = array("{name:&#39;id&#39;,index:&#39;id&#39;, editable:false,editoptions:{readonly:true,size:10}}",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; "{name:&#39;role_id&#39;,index:&#39;role_id&#39;, editable:true,editoptions:{size:25}}",<br />&#160;&#160;&#160; &#160;&#160;&#160; "{name:&#39;username&#39;,index:&#39;username&#39;, editable:true,editoptions:{size:25}}",<br />&#160;&#160;&#160; &#160;&#160;&#160; "{name:&#39;password&#39;,index:&#39;password&#39;, editable:true,editoptions:{size:25}}",<br />&#160;&#160;&#160; &#160;&#160;&#160; "{name:&#39;first_name&#39;,index:&#39;first_name&#39;, editable:true,editoptions:{size:25}}",<br />&#160;&#160;&#160; &#160;&#160;&#160; "{name:&#39;last_name&#39;,index:&#39;last_name&#39;, editable:true,editoptions:{size:25}}", <br />&#160;&#160;&#160; &#160;&#160;&#160; "{name:&#39;email&#39;,index:&#39;email&#39;, editable:true,editoptions:{size:25}}");<br />&#160;&#160;&#160; &#160;&#160;&#160; echo json_encode($test);<br />&#160;&#160;&#160; }</p>
</p>
<p>The javascript end:</p>
<p>$.ajax({<br />&#160;&#160;&#160; &#160; url: basedir+"users/test",<br />&#160;&#160;&#160; &#160; dataType: &#39;json&#39;,<br />&#160;&#160;&#160; &#160; success: function(data){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var colnames = data.colnames;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var colmodel = data.colmodel; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; $("#usergrid").jqGrid({&#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;&#160;&#160; url: &#39;path&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; datatype: "json",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; colNames: colnames,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; colModel: colmodel,<br />&#160;&#160;&#160; &#160;&#160;&#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; });</p>
<p>&#160;&#160;&#160;&#160;&#160; }</p>
<p>});</p>
<p>So you can create the full colModel en colNames in the backend, then call it through ajax and then build the grid wih that data.</p>
<p>I hope this is helpfull to anyone.</p>
<p>Kind Regards,</p>
<p>Karel-Jan</p>
]]></description>
        	        	<pubDate>Wed, 20 Aug 2008 03:02:04 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1609</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1609</guid>
        	        	<description><![CDATA[<p>Currently this is not possible. If you need some simple you can use hidden columns and the hideCol and showCol methods</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 20 Aug 2008 01:29:21 +0300</pubDate>
        </item>
        <item>
        	<title>spacialk on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1601</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1601</guid>
        	        	<description><![CDATA[<p>Yes but can you change it after the grid is made? Or add some columns dynamicly</p>
]]></description>
        	        	<pubDate>Tue, 19 Aug 2008 14:31:57 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1596</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1596</guid>
        	        	<description><![CDATA[<p>There are a couple of ways depending on what you want to do.</p>
<p>Declare two variables - one for colNames the other for colModel -</p>
<p>on the server construct these arrays and pass them before constructing the grid.</p>
<p>Also you can construct the whole page with PHP and etc.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 19 Aug 2008 11:54:20 +0300</pubDate>
        </item>
        <item>
        	<title>spacialk on Dynamic colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1590</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colmodel#p1590</guid>
        	        	<description><![CDATA[<p>How can I dynamicly load colNames and colModels from a backend? My backend system is php and I want to generate a grid depending on the content that is pushed from my backend.</p>
<p>Thanx</p>
]]></description>
        	        	<pubDate>Tue, 19 Aug 2008 11:27:18 +0300</pubDate>
        </item>
</channel>
</rss>