<?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: typing bug with max/min in addJSONData and addXmlData</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata</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/typing-bug-with-maxmin-in-addjsondata-and-addxmldata/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on typing bug with max/min in addJSONData and addXmlData</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata#p25480</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata#p25480</guid>
        	        	<description><![CDATA[<p>Congratulation!</p>
<p>It&#39;s good to publish releases with bug fixes.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Tue, 20 Dec 2011 13:07:41 +0200</pubDate>
        </item>
        <item>
        	<title>tony on typing bug with max/min in addJSONData and addXmlData</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata#p25479</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata#p25479</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>No need to say Sorry. I must say Thank you.</p>
<p>Just released the 4.3.1</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 20 Dec 2011 12:25:47 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on typing bug with max/min in addJSONData and addXmlData</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata#p25471</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/typing-bug-with-maxmin-in-addjsondata-and-addxmldata#p25471</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>in addJSONData and addXmlData there are typing bug (the lines <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.0/js/grid.base.js#L1212" target="_blank">1212</a> and <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.0/js/grid.base.js#L1383" target="_blank">1383</a>):</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3441' value='Select Code' data-codeid='sfcode3441' /></p>
<div class='sfcode' id='sfcode3441'>ts.p.lastpage = Math.min( ts.p.page, Math.ceil(gl/ rn) );</div>
<p>or</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4155' value='Select Code' data-codeid='sfcode4155' /></p>
<div class='sfcode' id='sfcode4155'>ts.p.lastpage = Math.min( ts.p.page, Math.ceil(len/ rn) );</div>
<p>should be fixed to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3363' value='Select Code' data-codeid='sfcode3363' /></p>
<div class='sfcode' id='sfcode3363'>ts.p.lastpage = Math.<strong>max</strong>( ts.p.page, Math.ceil(gl/ rn) );</div>
<p>or</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4486' value='Select Code' data-codeid='sfcode4486' /></p>
<div class='sfcode' id='sfcode4486'>ts.p.lastpage = Math.<strong>max</strong>( ts.p.page, Math.ceil(len/ rn) );</div>
<p>Probobly even better to go back to the original lines</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7652' value='Select Code' data-codeid='sfcode7652' /></p>
<div class='sfcode' id='sfcode7652'>ts.p.lastpage = Math.ceil(gl/rn);</div>
<p>and</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4236' value='Select Code' data-codeid='sfcode4236' /></p>
<div class='sfcode' id='sfcode4236'>ts.p.lastpage = Math.ceil(len/rn);</div>
<p>To reproduce the bug one can just fill the grid having <strong>loadonce: true</strong>&#160;option with many pages of data. If the <strong>page</strong>&#160;parameter of the JSON data are set for example to 1 (the first page schould be displayed), then the <strong>lastpage</strong>&#160;will be set to 1, corresponds to the above described bug, instead of <strong>Math.ceil(len/rn)</strong> which correspond to the number of read records.</p>
<p>It&#39;s bug from my old suggestion. After the line <a href="https://github.com/tonytomov/jqGrid/blob/v4.3.0/js/grid.base.js#L1117" target="_blank">1117</a> with</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6452' value='Select Code' data-codeid='sfcode6452' /></p>
<div class='sfcode' id='sfcode6452'>if (gl &#62; 0 &#38;&#38;  ts.p.page &#60;= 0) { ts.p.page = 1; }</div>
<p>and the line&#160;<a href="https://github.com/tonytomov/jqGrid/blob/v4.3.0/js/grid.base.js#L1286" target="_blank">1286</a>&#160;with</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6289' value='Select Code' data-codeid='sfcode6289' /></p>
<div class='sfcode' id='sfcode6289'>if (len &#62; 0 &#38;&#38; ts.p.page &#60;= 0) { ts.p.page = 1; }</div>
<p>were included in the jqGrid code the real problem which should fix <strong>ts.p.lastpage = Math.max( ts.p.page, Math.ceil(gl/ rn) );</strong> will be eliminiet. Sorry.</p>
<p>Best regards<br />Oleg&#160;</p></p>
]]></description>
        	        	<pubDate>Mon, 19 Dec 2011 19:47:06 +0200</pubDate>
        </item>
</channel>
</rss>