<?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 colName &#38; colModel</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-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-colname-colmodel/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Gordon on Dynamic colName &#38; colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-colmodel#p18531</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-colmodel#p18531</guid>
        	        	<description><![CDATA[<p>ok, I understand ..<br />A regular means  it can be done?</p>
<p>..means in jqgrid.</p>
]]></description>
        	        	<pubDate>Mon, 12 Jul 2010 01:54:06 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Dynamic colName &#38; colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-colmodel#p18437</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-colmodel#p18437</guid>
        	        	<description><![CDATA[<p>You can remove old jqGrid with respect of jQuery.remove(). jqGrid create some additional dives over the table element and the pager div. So if your table has id="list" you should remove div with the id="gbox_list". It contains all other dives. After calling of jQuery.remove() you will have no more table and pager dive, so you have to insert there also&#160;dynamically&#160;for example with jQuery.after() method. To do this you have to have on the html page an&#160;anchor&#160;(an element with known id) which you will use in the jQuery.after() method.</p>
<p>Alternatively you can place the table element and the pager div inside another div and call jQuery.empty() and jQuery.html() methods with the id of this parent div to remove and to insert the jqGrid dynamically.&#160;</p>
]]></description>
        	        	<pubDate>Wed, 07 Jul 2010 13:56:15 +0300</pubDate>
        </item>
        <item>
        	<title>Gordon on Dynamic colName &#38; colModel</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-colmodel#p18435</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colname-colmodel#p18435</guid>
        	        	<description><![CDATA[<p>Hi</p>
<p>When create a table I want to dynamically create columns, depending on the structure of the database.</p>
<p>I write:</p>
<p>$(document).ready(function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;names = [];<br />&#160;&#160; &#160;&#160;&#160; &#160;model = [];<br />&#160;&#160; &#160;$.getJSON("/jsonrpc/dispatcher.get_raion_names", {}, function(data) {<br />&#160;&#160; &#160;&#160;&#160; &#160;for (i=0; i&#60;data.result.length; i++){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;names[i] = data.result[i][0];<br />&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;for (i=0; i&#60;data.result.length; i++) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;model[i] = {name:data.result[i][0], index:data.result[i][1], width:80, align:&#39;center&#39;, sortable:false};<br />&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;console.info(names, model);<br />&#160;&#160; &#160;});<br />&#160;&#160; &#160;$("#jgrid_raions").jqGrid({<br />&#160;&#160; &#160;&#160;&#160; &#160;sortable: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;url: &#39;/dispatcher/json/get_raions&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;colNames: window.names,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: window.model,<br />&#160;&#160; &#160;&#160;&#160; &#160;rowNum:15, <br />&#160;&#160; &#160;&#160;&#160; &#160;rowList:[15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40], <br />&#160;&#160; &#160;&#160;&#160; &#160;mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: $(&#39;#pager_raions&#39;),<br />&#160;&#160; &#160;&#160;&#160; &#160;autowidth: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //width: window.width-1,<br />&#160;&#160; &#160;&#160;&#160; &#160;rownumbers: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;sortname: &#39;#&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;sortorder: "desc",<br />&#160;&#160; &#160;&#160;&#160; &#160;height: "100%",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;viewrecords: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;toolbar : [true,"top"],<br />&#160;&#160; &#160;&#160;&#160; &#160;altRows : true,<br />&#160;&#160; &#160;&#160;&#160; &#160;//hoverrows: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;//toolbar : [true,"bottom"],<br />&#160;&#160; &#160;&#160;&#160; &#160;//shrinkToFit :false,<br />&#160;&#160; &#160;&#160;&#160; &#160;//rownumbers: true, <br />&#160;&#160; &#160;&#160;&#160; &#160;//rownumWidth: 40,<br />&#160;&#160; &#160;&#160;&#160; &#160;gridview: false, &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;loadui: &#39;disable&#39;,<br />&#160;&#160;&#160; });</p>
<p>&#160;&#160; &#160;$("#t_jgrid_raions").height(25).jqGrid(&#39;filterGrid&#39;,"jgrid_raions",{<br />&#160;&#160; &#160;&#160;&#160; &#160;gridModel:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;gridToolbar:true,&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; enableSearch: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; enableClear: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; autosearch: false&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;}).css("display", "none");<br />&#160;&#160; &#160;$("#jgrid_raions").jqGrid(&#39;navGrid&#39;,&#39;#pager_raions&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;{edit:false,add:false,del:false,search:false,refresh:false }, <br />&#160;&#160; &#160;&#160;&#160; &#160;{}, // edit options <br />&#160;&#160; &#160;&#160;&#160; &#160;{}, // add options <br />&#160;&#160; &#160;&#160;&#160; &#160;{}, //del options <br />&#160;&#160; &#160;&#160;&#160; &#160;{multipleSearch:true} // search options<br />&#160;&#160; &#160;);</p>
<p>FireBug write:</p>
<p>names = ["ÐÐ¼ÐµÑ€Ð¸ÐºÐ°", "ÐÑ„Ñ€Ð¸ÐºÐ°"]</p>
<p>model = [Object {&#160; name="ÐÐ¼ÐµÑ€Ð¸ÐºÐ°",&#160; more...}, Object { name="ÐÑ„Ñ€Ð¸ÐºÐ°",&#160; more...}]</p>
<p>but grid not work..</p>
<p>p.s. sorry for my english..</p>
]]></description>
        	        	<pubDate>Wed, 07 Jul 2010 12:17:58 +0300</pubDate>
        </item>
</channel>
</rss>