<?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: rowNum and resetting grid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/rownum-and-resetting-grid</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/rownum-and-resetting-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on rowNum and resetting grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/rownum-and-resetting-grid#p21557</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/rownum-and-resetting-grid#p21557</guid>
        	        	<description><![CDATA[<p>The usage of rowNum equal to -1 or other negative value is wrong and not supported (at list for local jqGrid data). If you look at <a href="/jqgridwiki/doku.php?id=wiki:options" target="_blank">the documentation</a> you can see that the sentance about -1 value is removed. You can use any large value instead (1000, 10000), but it is strictly recomended to use small values of rowNum which follows to data pagination. It is much more effective and comfortable for the user. No display can show 1000 rows at once. Scrolling of data inside web browser is less effective as jqGrid pagination. Moreover no real person are able to read and analyse so many information items. The usage of <a href="/jqgridwiki/doku.php?id=wiki:toolbar_searching" target="_blank">toolbar searching</a>, <a href="/jqgridwiki/doku.php?id=wiki:advanced_searching" target="_blank">advance searching</a> and other <a href="/jqgridwiki/doku.php?id=wiki:jqgriddocs#searching" target="_blank">searching possibilities</a> of jqGrid could provide together with the local pagination the best user expirience.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Wed, 05 Jan 2011 23:26:32 +0200</pubDate>
        </item>
        <item>
        	<title>brg07003 on rowNum and resetting grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/rownum-and-resetting-grid#p21556</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/rownum-and-resetting-grid#p21556</guid>
        	        	<description><![CDATA[<p>I am having an issue with resetting the search filter on a grid when the rowNum is set to -1. I have a loadonce grid that receives json data then works completely on the client side. Part of its functionality involves programmatically applying a filter to it. To apply the filter I wrote the following method:</p>
<blockquote>
<p>function searchGrid(gridId, field, string) {</p>
<p>&#160;&#160; &#160;var grid = $(&#39;#&#39; + gridId);</p>
<p>&#160;&#160; &#160;var postdata = grid.jqGrid(&#39;getGridParam&#39;, &#39;postData&#39;);</p>
<p>&#160;&#160; &#160;$.extend(postdata,</p>
<p>&#160;&#160; &#160; &#160; &#160;{ filters: &#39;&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; searchField: field,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; searchOper: &#39;eq&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; searchString: string</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160;});</p>
<p>&#160;&#160; grid.jqGrid(&#39;setGridParam&#39;, { search: true, postData: postdata });</p>
<p>&#160;&#160; grid.trigger("reloadGrid", [{ page: 1}]);</p>
<p>}</p>
</blockquote>
<p>The function for clearing the filter on a grid is as follows:</p>
<blockquote>
<p>&#160;function resetGrid(grdName) {</p>
<p>&#160;var grid = $(&#39;#&#39; + grdName);</p>
<p>&#160;grid.jqGrid(&#39;setGridParam&#39;, { search: false });</p>
<p>var postData = grid.jqGrid(&#39;getGridParam&#39;, &#39;postData&#39;);</p>
<p>$.extend(postData,{searchField:"",searchString:"",searchOper:""});</p>
<p>grid.trigger("reloadGrid", [{ page: 1}]);</p>
</blockquote>
<p>When I set the rowNum option for the grid to a number, the above works as expected. When I set rowNum to -1, the grid initially contains all of the rows (as expected). But when I try to search the grid or reset it, it shows the correct rows but one is chopped off. For example, say the grid pull back 10 rows. Before I use either of &#160;the above methods, the grid has 10 rows. If I call the reset method, the grid now has 9 rows (instead of 10). If I perform a search that should retrieve 1 result, the grid is empty (should show the 1 result).</p></p>
]]></description>
        	        	<pubDate>Wed, 05 Jan 2011 22:44:42 +0200</pubDate>
        </item>
</channel>
</rss>