<?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: getGridParam("colModel")</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel</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/getgridparamcolmodel/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14201</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14201</guid>
        	        	<description><![CDATA[<p>Mark,</p>
<p>Thanks. Fixed.</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 24 Jan 2010 17:56:47 +0200</pubDate>
        </item>
        <item>
        	<title>markw65 on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14197</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14197</guid>
        	        	<description><![CDATA[<p>So yes, it is a bug. The problem is that splice has two /required/ parameters. The first is the index of the point to insert/delete, and the second is the number of elements to delete. (Subsequent parameters are elements to be inserted after the deletes have taken place)</p>
</p>
<p>I&#39;m guessing that most browsers treat the single parameter case as "delete 1", but chrome treats it as "delete to end of array".</p>
</p>
<p>Since omitting the second parameter is an error, either behavior is allowed.</p>
</p>
<p>So a simpler (and probably more efficient) fix would be to change it to splice(0,1);</p>
</p>
<p>Mark</p>
]]></description>
        	        	<pubDate>Sun, 24 Jan 2010 17:36:17 +0200</pubDate>
        </item>
        <item>
        	<title>telubeer on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14193</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14193</guid>
        	        	<description><![CDATA[</p>
<p>Yes, this is a bug. If the goal is just remove first column from an array we need to use x=x.slice(1) method bkz x.splice(0) just truncate our arrays if we use browser different from IE.</p>
</p>
<p>If you dont want wait when Tony fix it in github &#160;you can make changes yourself.</p></p>
]]></description>
        	        	<pubDate>Sun, 24 Jan 2010 07:20:13 +0200</pubDate>
        </item>
        <item>
        	<title>mryle on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14186</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14186</guid>
        	        	<description><![CDATA[<p>Howdy telubeer,</p>
</p>
<p>I&#39;m relatively new to this level of complexity in JavaScript but I&#39;m guessing that what you are doing is using Google Chrome&#39;s equivalent to Firebug and that you&#39;re finding a bug in the grid.import.js file.&#160; Am I correct?&#160; Is this something I should be changing in the library myself or was this just a note to Tony?</p>
</p>
<p>Thanks,</p>
<p>mryle</p>
]]></description>
        	        	<pubDate>Fri, 22 Jan 2010 21:33:14 +0200</pubDate>
        </item>
        <item>
        	<title>telubeer on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14095</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p14095</guid>
        	        	<description><![CDATA[</p>
<div class="console-user-command console-adjacent-user-command-result">tonytomov-jqGrid-5fae4e1</div>
<div class="console-user-command console-adjacent-user-command-result">lets &#8220;manual jqGridExport&#8221;</div>
<div class="console-user-command console-adjacent-user-command-result">google-chrome console:</div>
<div class="console-user-command console-adjacent-user-command-result">in:$(&#39;#s1list&#39;).jqGrid(&#39;getGridParam&#39;,&#39;colModel&#39;);</div>
<div class="console-message console-js-source console-log-level console-user-command-result"><span class="console-message-text source-code"><span><span class="console-formatted-array source-code">out:[Object,Object,Object]</span></span></span></div>
<div class="console-message console-js-source console-log-level console-user-command-result">
<div class="console-user-command console-adjacent-user-command-result"><span class="console-message-text source-code">in:var op=$(&#39;#s1list&#39;).jqGrid(&#39;getGridParam&#39;,&#39;colModel&#39;)</span></div>
<div class="console-message console-js-source console-log-level console-user-command-result"><span class="console-message-text source-code"><span><span class="console-formatted-undefined source-code">out:undefined</span></span></span></div>
</div>
<div class="console-message console-js-source console-log-level console-user-command-result">in:op</div>
<div class="console-message console-js-source console-log-level console-user-command-result">out:[Object,Object,Object]</div>
<div class="console-message console-js-source console-log-level console-user-command-result">in:op.splice(0);</div>
<div class="console-message console-js-source console-log-level console-user-command-result">out:[Object,Object,Object]</div>
<div class="console-message console-js-source console-log-level console-user-command-result">in:op</div>
<div class="console-message console-js-source console-log-level console-user-command-result">out:[]</div>
<div class="console-message console-js-source console-log-level console-user-command-result">
<div class="console-user-command console-adjacent-user-command-result"><span class="console-message-text source-code">in:$(&#39;#s1list&#39;).jqGrid(&#39;getGridParam&#39;,&#39;colModel&#39;)</span></div>
<div class="console-message console-js-source console-log-level console-user-command-result"><span class="console-message-text source-code"><span><span class="console-formatted-array source-code">out:[]</span></span></span></div>
</div>
<div class="console-message console-js-source console-log-level console-user-command-result">Ð¾_Ðž</div>
</p>
<p>hotfix:</p>
<p>in grid.import.js</p>
<p>replace all:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8000' value='Select Code' data-codeid='sfcode8000' /></p>
<div class='sfcode' id='sfcode8000'>
<p>gprm.colNames.splice(0);</p>
<p>gprm.colModel.splice(0);&#160;</p>
</div>
<p>with:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4346' value='Select Code' data-codeid='sfcode4346' /></p>
<div class='sfcode' id='sfcode4346'>
<p>gprm.colNames=gprm.colNames.slice(1);</p>
<p>gprm.colModel=gprm.colModel.slice(1);</p>
</div>
]]></description>
        	        	<pubDate>Thu, 21 Jan 2010 07:30:30 +0200</pubDate>
        </item>
        <item>
        	<title>tony on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13955</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13955</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks for the feedback. This is very interesting. In order to resolve the problem I need a link to the problem.</p>
<p>I have try diffrent girds with diffrent configuration and the export for me work OK simulating your command.</p>
<p>Thanks</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 15 Jan 2010 19:40:30 +0200</pubDate>
        </item>
        <item>
        	<title>mryle on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13924</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13924</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
</p>
<p>Ok.&#160; I downloaded the current Development code from GitHub and create a development instance of my app.&#160; I went loaded my grid, which by the way loaded without error, made sure it was referencing the development code correctly and then ran:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5590' value='Select Code' data-codeid='sfcode5590' /></p>
<div class='sfcode' id='sfcode5590'>jQuery("#list").jqGridExport({"exptype":"jsonstring"})</div>
</p>
<p>in Firebug wtihin FF.&#160; The &#39;colModel&#39; and &#39;colNames&#39; arrays still are showing up empty in the output in Firebug:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3738' value='Select Code' data-codeid='sfcode3738' /></p>
<div class='sfcode' id='sfcode3738'>"{"grid":{ 		"url":"jqGridCrudHw.php", 		"height":600, 		"page":1, 		"rowNum":25, 		"records":250, 		"pager":"#pager", 		"pgbuttons":true, 		"pginput":true, 		"colModel":[], 		"rowList":[ 			25, 			100, 			500 		], 		"colNames":[], 		"sortorder":"asc", 		"sortname":3, 		"datatype":"json", 		"mtype":"POST",....</div>
</p>
<p>I ran the same command using Companion.JS in IE and the &#39;colModel&#39; and &#39;colNames&#39; arrays are populated correctly.</p>
</p>
<p>Thanks again for the help...I&#39;ll keep working it from my end to see if I can come up with a different approach to store the visible columns in a cookie.&#160; Let me know if you have any other ideas.</p>
]]></description>
        	        	<pubDate>Fri, 15 Jan 2010 01:10:16 +0200</pubDate>
        </item>
        <item>
        	<title>tony on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13913</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13913</guid>
        	        	<description><![CDATA[<p>@mryle</p>
<p>Could you please try the last one from GitHub. I have done more on this. Thanks</p>
<p>@vik</p>
<p>Could not understand really Why not try <img class="spSmiley" style="margin:0" title="Wink" src="http://www.trirand.com/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" /></p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 21:32:06 +0200</pubDate>
        </item>
        <item>
        	<title>vik on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13888</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13888</guid>
        	        	<description><![CDATA[<p>Hi Tony/<strong></strong><strong>Mryle,</strong></p>
</p>
<p>i was just going through this post. Well i want to dynamically add columns to my grid (the column names will come from a dropdown in my page,so i cannot hardcode the column names as it may change anytime <img class="spSmiley" style="margin:0" title="Yell" src="/blog/wp-content/forum-smileys/sf-yell.gif" alt="Yell" />).Can i use yhis piece of code to add columns dynamically in my grid.</p>
<p>Please reply.</p>
</p>
<p>Thanks.</p>
</p>
<p>Sourav(Vik)</p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 11:35:06 +0200</pubDate>
        </item>
        <item>
        	<title>mryle on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13869</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13869</guid>
        	        	<description><![CDATA[<p>Ok, I will install 3.6.2 and see what happens.&#160;</p>
</p>
<p>I just ran &#39;<span class="objectBox objectBox-text">jQuery(&#8221;#list&#8221;).jqGridExport({&#8221;exptype&#8221;:&#8221;jsonstring&#8221;})&#39; in Companion.JS in IE and sure enough both colModel and colNames arrays were populated correctly.&#160; Does that mean that the jqGridExport method (at least in 3.6.1) does not work with Firefox?</span></p>
</p>
<p>Thanks again</p>
</p>
<p>By the way, I just upgraded to 3.6.2, reloaded my grid in FF and ran jqGridExport again.&#160; There is still no data in the colModel or colNames arrays.</p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 19:49:18 +0200</pubDate>
        </item>
        <item>
        	<title>tony on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13866</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13866</guid>
        	        	<description><![CDATA[<p>HEllo,</p>
<p>Could you please try with 3.6.2 - Also the export maybe work OK in IE - is this right?<br />Tony</p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 19:27:43 +0200</pubDate>
        </item>
        <item>
        	<title>mryle on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13863</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13863</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
</p>
<p>I&#39;m using 3.6.1.&#160; I will look into the cookie size issue as well.&#160; Thanks for pointing this out.&#160; By the way, when I run the following in Firebug after my grid has loaded, I get the following:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4568' value='Select Code' data-codeid='sfcode4568' /></p>
<div class='sfcode' id='sfcode4568'>
<div class="logRow logRow-command"><span class="objectBox objectBox-text">&#62;&#62;&#62; jQuery("#list").jqGridExport({"exptype":"jsonstring"})</span></div>
<p><span class="objectBox objectBox-string">"{"grid":{ 		"url":"jqGridCrudHw.php", 		"height":600, 		"page":1, 		"rowNum":25, 		"records":250, 		"pager":"#pager", 		"pgbuttons":true, 		"pginput":true, 		"colModel":[], 		"rowList":[ 			25, 			100, 			500 		], 		"colNames":[], 		"sortorder":"asc", 		"sortname":3,.......</span></p>
</div>
<p>Notice that &#39;colModel&#39; and &#39;colNames&#39; are empty.&#160; Not sure this helps with anything but I thought I&#39;d at least show you what I was seeing.</p></p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 19:24:57 +0200</pubDate>
        </item>
        <item>
        	<title>tony on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13860</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13860</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>This is not correct with the export. Which version do you use?</p>
<p>Also remember cookie are with limited size (could not remember how - but not so much)</p>
<p>Also the correct my code above should be:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5586' value='Select Code' data-codeid='sfcode5586' /></p>
<div class='sfcode' id='sfcode5586'>
<p>var cookieColumns = $.extend([],$(&#8221;#list&#8221;).getGridParam(&#8221;colModel&#8221;));</p>
<p>var cookieNames = $.extend([],$(&#8221;#list&#8221;).getGridParam(&#8221;colNames&#8221;));</p>
<p>if(this.p.rownumbers) {</p>
<p>&#160;&#160; cookieColumns.splice(0);</p>
<p>&#160;&#160; cookieNames.splice(0);</p>
<p>}</p>
<p>&#8230;.</p>
</p>
</div>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 19:11:39 +0200</pubDate>
        </item>
        <item>
        	<title>mryle on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13803</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13803</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
</p>
<p>Thank you very much for taking the time to respond.&#160;</p>
</p>
<p>So in order to save the users preference of viewable columns to a cookie, would it be best to use the jqGridExport and jqGridImport methods instead of the approach listed above?</p>
</p>
<p>Thanks again!</p>
</p>
<p>Side Note:&#160; I played with the jqGridExport method yesterday using Firebug and was able to export the current state of my grid.&#160; One thing I noticed though is that the ColModel and ColNames arrays were both empty.&#160; Is this correct?&#160; If so, I&#39;m not sure how using the export method would help me save a users column layout to a cookie.&#160; I&#39;m probably just missing something(?)...</p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 01:16:17 +0200</pubDate>
        </item>
        <item>
        	<title>tony on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13331</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13331</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>In order to do this you should use a</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3904' value='Select Code' data-codeid='sfcode3904' /></p>
<div class='sfcode' id='sfcode3904'>
<p>var cookieColumns = $(&#8221;#list&#8221;).getGridParam(&#8221;colModel&#8221;);</p>
<p>var cookieNames = $(&#8221;#list&#8221;).getGridParam(&#8221;colNames&#8221;);</p>
<p>if(this.p.rownumbers) {</p>
<p>&#160;&#160; cookieColumns.splice(0);</p>
<p>&#160;&#160; cookieNames.splice(0);</p>
<p>}</p>
<p>&#8230;.</p>
</p>
</div>
<p>or simple use label option in colModel of place of the colNames &#8211; in this case you will need to splice only the cookieColumns</p>
<p>Something similar is done in grid.import.js &#8211; see jqGridExport method.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 26 Dec 2009 12:26:28 +0200</pubDate>
        </item>
        <item>
        	<title>mryle on getGridParam("colModel")</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13273</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getgridparamcolmodel#p13273</guid>
        	        	<description><![CDATA[<p>Howdy All,</p>
</p>
<p>I&#39;m attempting to save users column choices from the the Column Chooser to a cookie.&#160; Here&#39;s the snippet of code I&#39;m using:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9933' value='Select Code' data-codeid='sfcode9933' /></p>
<div class='sfcode' id='sfcode9933'>jQuery("#list").jqGrid(&#39;columnChooser&#39;, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; done : function (perm) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (perm) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.jqGrid("remapColumns", perm, true);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var cookieColumns = $("#list").getGridParam("colModel");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.cookie("columns", cookieColumns, { expires: 365 });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; });</div>
<p>This snippet itself is working fine.&#160; The probelm I run into is when I try to load value of the cookie into the colModel, I&#39;m getting the standard error:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9903' value='Select Code' data-codeid='sfcode9903' /></p>
<div class='sfcode' id='sfcode9903'>Length of colNames &#60;&#62; colModel!</div>
<p>After doing some debugging, what I&#39;m noticing is that the *.getGridParam("colModel") picks up a "rn" column, which is because I have row numbering turned on.&#160; So when I do something like this to load the cookie into the colModel:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2735' value='Select Code' data-codeid='sfcode2735' /></p>
<div class='sfcode' id='sfcode2735'>function returnColModel() {<br />&#160;&#160;&#160; if($.cookie("columns")) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return $.cookie("columns");<br />&#160;&#160;&#160; } else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return staticColumns;<br />&#160;&#160;&#160; }<br />}</div>
<p>and then:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7745' value='Select Code' data-codeid='sfcode7745' /></p>
<div class='sfcode' id='sfcode7745'>colModel: returnColModel(),</div>
<p>I&#39;m picking up an extra column (rn) that is causing the error above.&#160;</p>
<p>Is there any way I can easily get around picking up the &#39;rn&#39; column when using getGridParam("colModel") so I can store and retrieve this info via cookie?&#160; I apologize in advance if this is more of a JavaScript question and not entirely related to JqGrid.</p>
<p>Thanks!</p></p>
]]></description>
        	        	<pubDate>Wed, 23 Dec 2009 10:14:32 +0200</pubDate>
        </item>
</channel>
</rss>