<?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: Dynamically add columns to the jqgrid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dynamically-add-columns-to-the-jqgrid</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/dynamically-add-columns-to-the-jqgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>manjushree.nimbalkar on Dynamically add columns to the jqgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamically-add-columns-to-the-jqgrid#p27478</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamically-add-columns-to-the-jqgrid#p27478</guid>
        	        	<description><![CDATA[<p>hello,</p>
</p>
<p>After 2 days of search this is how i add columns dynamically to jqgrid</p>
<pre>function&#160;loadGrid()&#160;{
&#160;&#160;&#160;&#160;var&#160;svcUrl&#160;=&#160;&#39;Services/Info.svc&#39;;
&#160;&#160;&#160;
&#160;&#160;&#160; $.ajax({
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;type:&#160;"POST",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;url:&#160;svcUrl&#160;+&#160;"/GetInfo",
&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType:&#160;"application/json;&#160;charset=utf-8",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;dataType:&#160;"json",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;success:&#160;function&#160;(response)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;obj&#160;=&#160;response.GetInfoResult;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;cnames&#160;=&#160;JSON.parse(obj.ColNames);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;cmodel&#160;=&#160;JSON.parse(obj.ColModel);
 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$("#tblInfo").empty().jqGrid({
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;datatype:&#160;"local",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;height:&#160;200,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colNames:&#160;cnames,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colModel:&#160;cmodel,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;width:&#160;500,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pager:&#160;"#pager",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rowList:&#160;[10,&#160;20,&#160;30],
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rowNum:&#160;10,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;emptyrecords:&#160;"No&#160;records&#160;to&#160;view",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortorder:&#160;"asc",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;viewrecords:&#160;true,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;loadtext:&#160;"Loading....",
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortable:&#160;true
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;});
 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;mydata&#160;=&#160;JSON.parse(JSON.parse(obj.ColData).Row);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for&#160;(dr&#160;in&#160;mydata)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$("#tblInfo").jqGrid(&#39;addRowData&#39;,&#160;dr,&#160;mydata[dr]);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;error:&#160;function&#160;(response)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;alert(response.responseText);&#160;}
&#160;&#160;&#160;&#160;});
&#160;&#160;&#160;&#160;return&#160;false;
}<br /><br />The data for ColNames, ColData and ColModel comes from WCF service.<br /><br />Thanks,<br />Manju<br /></pre>
]]></description>
        	        	<pubDate>Wed, 03 Oct 2012 23:46:20 +0300</pubDate>
        </item>
        <item>
        	<title>manjushree.nimbalkar on Dynamically add columns to the jqgrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamically-add-columns-to-the-jqgrid#p27468</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamically-add-columns-to-the-jqgrid#p27468</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Is it possible to add columns dynamically to the jqgrid? If yes, will someone please let me know how to do it?</p>
<p>I read about Import configuration, is there any example to achieve importing using Json???</p>
<p>Waiting for reply. Thanks in Advance.</p>
</p>
<p>Manju</p></p>
]]></description>
        	        	<pubDate>Wed, 03 Oct 2012 00:32:04 +0300</pubDate>
        </item>
</channel>
</rss>