<?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: Error "Length of colNames  colModel!" when adding only one column using jqGridImport</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-length-of-colnames-colmodel-when-adding-only-one-column-using-jqgridimport</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/bugs/error-length-of-colnames-colmodel-when-adding-only-one-column-using-jqgridimport/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Error "Length of colNames  colModel!" when adding only one column using jqGridImport</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-length-of-colnames-colmodel-when-adding-only-one-column-using-jqgridimport#p21828</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/error-length-of-colnames-colmodel-when-adding-only-one-column-using-jqgridimport#p21828</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Interesting. I will check this behaviour.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 26 Jan 2011 17:36:40 +0200</pubDate>
        </item>
        <item>
        	<title>kellymiller77 on Error "Length of colNames  colModel!" when adding only one column using jqGridImport</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/error-length-of-colnames-colmodel-when-adding-only-one-column-using-jqgridimport#p21738</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/error-length-of-colnames-colmodel-when-adding-only-one-column-using-jqgridimport#p21738</guid>
        	        	<description><![CDATA[<p>I&#39;ve discovered a bug when trying to load the grid with the jqGridImport method<br /> when the data only contains one record. The ImpType is xml.</p>
<p>When I debugged the javascript, it was clear that when the xml got converted to json, <br />the colNames resulted as a string and not an array (when there was only one).</p>
<p>Therefore, later in the code when the colNames.length gets compared to the colModel.length, <br />the length of colNames was 12 (the length of the string), instead of 1<br />(the length of the array &#8211; had it been converted properly).</p>
<p>So I receive a javascript alert with the message "Length of colNames &#60;&#62; colModel!" and no<br />data gets loaded into the grid. </p>
<p>As soon as I add another column to the grid, the colNames xml gets converted to an array<br />correctly and it passes the length check and the grid loads with data. </p>
<p>Is anyone aware of this bug?</p>
<p>Here is a sample of the xml being imported.</p>
<div class="netInfoResponseText netInfoText ">
<pre><p><input type='button' class='sfcodeselect' name='sfselectit3606' value='Select Code' data-codeid='sfcode3606' /></p><div class='sfcode' id='sfcode3606'>&#60;roots&#62;<br />&#60;grid&#62;<br />&#60;colModel&#62;<br />&#60;name&#62;[ColumnName]&#60;/name&#62;&#60;index&#62;DataField&#60;/index&#62;&#60;width&#62;0&#60;/width&#62;&#60;resizable&#62;false&#60;/resizable&#62;<br />&#60;/colModel&#62;<br />&#60;colNames&#62;[ColumnName]&#60;/colNames&#62;<br />&#60;url&#62;/Psr/GetGridContent&#60;/url&#62;<br />&#60;datatype&#62;xml&#60;/datatype&#62;<br />&#60;mtype&#62;POST&#60;/mtype&#62;<br />&#60;loadtext&#62;[loading]&#60;/loadtext&#62;<br />&#60;pgtext&#62;[Page] {0} [of] {1}&#60;/pgtext&#62;<br />&#60;emptyrecords&#62;[NoRecordsToView]&#60;/emptyrecords&#62;<br />&#60;rowNum&#62;0&#60;/rowNum&#62;<br />&#60;autowidth&#62;false&#60;/autowidth&#62;<br />&#60;height&#62;300&#60;/height&#62;<br />&#60;width&#62;800&#60;/width&#62;<br />&#60;shrinkToFit&#62;false&#60;/shrinkToFit&#62;<br />&#60;pager&#62;#gridId_680fcb8c-088f-42fa-869a-d5ef2ca2228b_pager&#60;/pager&#62;<br />&#60;/grid&#62;<br />&#60;/roots&#62;</div></pre>
</div>
]]></description>
        	        	<pubDate>Mon, 17 Jan 2011 23:17:12 +0200</pubDate>
        </item>
</channel>
</rss>