<?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: Page 1 of NaN in case of length of XML data is 0</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/nan-in-case-of-length-of-xml-data-is-0</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/nan-in-case-of-length-of-xml-data-is-0/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on Page 1 of NaN in case of length of XML data is 0</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/nan-in-case-of-length-of-xml-data-is-0#p24982</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/nan-in-case-of-length-of-xml-data-is-0#p24982</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>the described bug is still not fixed in the jqGrid 4.2.0. Do you forget about this or do you think that it&#39;s not needed to fix the problem?</p>
<p>Moreover I think, that it would be very practical and simple to allow to use functions (metods) inside of <strong>xmlReader</strong>. The implementation will be simple enough, but it would gives the user the same power to read practically any XML data like one can do this with JSON data. The usage of attributes instead of elements to represent the value of columns can be also easy possible in the way.</p>
<p>What is your opinion about this?</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 25 Oct 2011 13:40:17 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Page 1 of NaN in case of length of XML data is 0</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/nan-in-case-of-length-of-xml-data-is-0#p24566</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/nan-in-case-of-length-of-xml-data-is-0#p24566</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>in the past the same bug in case of XML data. The problem is very easy: the uninitialized variable <strong>rn</strong> is defined in the line <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.base.js#L1086" target="_blank">1086</a>&#160;of grid.base.js and it will be not set in case of <strong>gxml.length==0</strong>:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2925' value='Select Code' data-codeid='sfcode2925' /></p>
<div class='sfcode' id='sfcode2925'>var gl = gxml.length, j=0, grpdata={}, <strong>rn</strong>;<br />if(gxml &#38;&#38; gl){<br />&#160; &#160; rn = parseInt(ts.p.rowNum,10);&#160;</div>
<p>later in the line <a href="https://github.com/tonytomov/jqGrid/blob/v4.1.2/js/grid.base.js#L1086" target="_blank">1181</a>&#160;if will be used</p>
<p><input type='button' class='sfcodeselect' name='sfselectit394' value='Select Code' data-codeid='sfcode394' /></p>
<div class='sfcode' id='sfcode394'>if(locdata) {<br />&#160; &#160; ts.p.records = gl;<br />&#160; &#160; ts.p.lastpage = Math.ceil(gl/ <strong>rn</strong>);<br />}&#160;</div>
<p>For undefined <strong>rn</strong> the <strong>lastpage</strong> will be <strong>NaN</strong>.</p>
<p>To fix the problem one should just change the line 1086 to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5618' value='Select Code' data-codeid='sfcode5618' /></p>
<div class='sfcode' id='sfcode5618'>var gl = gxml.length, j=0, grpdata={}, rn = parseInt(ts.p.rowNum,10);</div>
<p>The line 1088 which contains the same assignment can be removed.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Thu, 08 Sep 2011 22:12:49 +0300</pubDate>
        </item>
</channel>
</rss>