<?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: Using Client Side Sorting But Server Side Paging using JQGrid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid</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/using-client-side-sorting-but-server-side-paging-using-jqgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>beMe on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid/page-2#p25576</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid/page-2#p25576</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>I&#39;m using&#160;v. 3.7 with mvc 2.0 and I have the same problem,</p>
<p>I tried your solution, the pager works.</p>
<p>but when sorting, nothing happens!</p>
<p>this is my code, can u tell me why does&#39;nt it work?</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4833' value='Select Code' data-codeid='sfcode4833' /></p>
<div class='sfcode' id='sfcode4833'>
<p>$(document).ready(function() {<br />$(&#34;#grid&#34;).jqGrid({<br />url: &#34;Delivery.mvc/RenderList?SeachP.fromDate=12/27/2011 00:00:00&#38;SeachP.toDate=01/04/2012 00:00:00&#38;SeachP.CustomerRecid=3&#38;SeachP.SubCustomerRecid=3&#38;SeachP.Type=1&#34;,<br />mtype: &#34;get&#34;,<br />datatype: &#34;json&#34;,<br />colNames: [&#34;ID&#34;,&#34;#&#34;,&#34;Status&#34;],<br />colModel: [{ name: &#34;ID&#34;, index: &#34;ID&#34;, width: 50, align: &#34;center&#34;, classes: &#34;&#34;, sortable: true, sorttype: &#34;int&#34;, editable: true, edittype: &#39;text&#39;}, <br />{ name: &#34;deliverynum&#34;, index: &#34;deliverynum&#34;, width: 100, align: &#34;center&#34;, classes: &#34;&#34;, sortable: true, sorttype: &#34;int&#34;, editable: true,&#160; edittype: &#39;text&#39;}, <br />{ name: &#34;Status&#34;, index: &#34;Status&#34;, width: 100, align: &#34;center&#34;, classes: &#34;&#34;, sortable: true, sorttype: &#34;text&#34;, editable: true, edittype: &#39;text&#39;}],<br />rowNum: 10,<br />beforeRequest: function ff(){_grid_beforeRequest(&#39;grid&#39;);},<br />beforeSelectRow: function fff(rowIndex,e){_grid_beforeSelectRow(&#39;grid&#39;,rowIndex);},<br />gridComplete: function f(){if (_isGridReady) {return;} else {_isGridReady=true;}onGridLoad()},<br />direction: &#34;rtl&#34;,<br />loadComplete: function(){$(&#34;#grid&#34;).setGridParam({datatype:&#39;local&#39;});},<br />onPaging: function(){$(&#34;#grid&#34;).setGridParam({datatype:&#39;json&#39;});},<br />height: 354,<br />rowList: -1,<br />pager: &#34;#gridPager&#34;,<br />sortable:true,<br />sortname: &#34;ID&#34;,<br />sortorder: &#34;asc&#34;,<br />autowidth: false,<br />onSelectRow: function(id){rowSelected($(&#34;#grid&#34;).getRowData(id));},<br />ondblClickRow: function(rowId, iRow, iCol, e) { dblClick (rowId,iRow,iCol,e); },<br />caption: &#34;&#34;}); });<br />$(&#34;#grid&#34;).bind(&#34;keydown&#34;, on_grid_keydown);</p>
</div>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Tue, 03 Jan 2012 16:31:48 +0200</pubDate>
        </item>
        <item>
        	<title>ericisko on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25396</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25396</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Same thing happens with gridComplete.</p>
<p>When you click on sort column, it will eventually call populate(). populate() will call addLocalData() (since datatype is changed to &#39;local&#39; in gridComplete). However, addLocalData() will return empty result set as ts.p.data is empty and subsequent call to addJSONData() will result in empty grid.</p>
<p>Even forcing population of ts.p.data in addJSONData() will not work - addLocalData() will change number of pages/records to that of ts.p.data array and that will disable paging - ts.p.data will have only one page of data as paging is on server side.</p>
</p>
<p>Erik</p>
]]></description>
        	        	<pubDate>Tue, 13 Dec 2011 16:38:19 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25381</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25381</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Try with gridComplete event instead of loadComplete</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Tue, 13 Dec 2011 09:29:38 +0200</pubDate>
        </item>
        <item>
        	<title>ericisko on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25373</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25373</guid>
        	        	<description><![CDATA[<p>loadComplete/onPaging solution does not seem to work with jqGrid 4.1.2.</p>
<p>Looking at the code, in case of &#39;datatype: json&#39; (or xml and maybe others), no data is stored on the client side (in ts.p.data) unless &#39;loadonce: true&#39; is specified. But if you specify &#39;loadonce: true&#39;, paging is disabled.</p>
</p>
<p>The 2 scenarios:</p>
<p>datatype: json, loadonce: false</p>
<ul>
<li>paging works (serverside)</li>
<li>sorting does not work (after doing sort, grid is empty)</li>
</ul>
<p>datatype: json, loadonce: true</p>
<ul>
<li>paging is disabled</li>
<li>sorting works (clientside)</li>
</ul>
<p>Erik</p>
]]></description>
        	        	<pubDate>Mon, 12 Dec 2011 21:15:18 +0200</pubDate>
        </item>
        <item>
        	<title>basil on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25340</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25340</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>&#160;&#160;&#160; I am trying to do clientside sorting and server side paging but I am using</p>
<p>datatype: function(){....}</p>
<p>when I try the method</p>
<p>loadComplete: function(){<br />&#160;&#160; &#160;&#160;&#160;&#160; grid.setGridParam({datatype:&#39;local&#39;});<br />&#160;&#160; &#160;},</p>
<p>it doesn&#39;t seem to work for me.&#160;&#160;</p>
<p>Is this because of the original def as a function?</p>
<p>thanks for any help</p>
<p>B</p></p>
]]></description>
        	        	<pubDate>Wed, 07 Dec 2011 21:47:02 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25278</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25278</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>It is wired. If you use loadonce : true</p>
<p>why do you use these? - this is not needed. Please look what loadonce do.</p>
<p>Actually you do not need to do anything in this case</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Wed, 30 Nov 2011 20:23:13 +0200</pubDate>
        </item>
        <item>
        	<title>newtonianb on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25276</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25276</guid>
        	        	<description><![CDATA[<p>If I do loadonce: true paging no longer works but sorting and searching works</p>
]]></description>
        	        	<pubDate>Wed, 30 Nov 2011 19:22:33 +0200</pubDate>
        </item>
        <item>
        	<title>newtonianb on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25274</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25274</guid>
        	        	<description><![CDATA[<p>I did this exactly and the paging works but when I try to do the search or the sorting by column field the entire data in the grid dissapears!</p>
]]></description>
        	        	<pubDate>Wed, 30 Nov 2011 19:11:32 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25270</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25270</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Everthing is OK IMHO, but you will need to remove the reloading the grid.</p>
<p>It is done automatically.</p>
<p>There is example here:</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:howto_grid_base#client_side_sorting_but_server_side_paging" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....ide_paging</a></p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Wed, 30 Nov 2011 13:07:45 +0200</pubDate>
        </item>
        <item>
        	<title>newtonianb on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25269</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25269</guid>
        	        	<description><![CDATA[<p>I tried that but it&#39;s not working. <strong>4.2.0</strong></p>
<p><strong></strong>The paging works but when I try to sort a field it blanks out the entire grid.</p>
<pre>   &#160;</pre>
<pre>$(document).ready(function(){
      $("#mygrid").jqGrid({
        url:&#39;<a rel="nofollow" href="http://localhost/data&#39;" target="_blank">http://localhost/data&#039;</a>,
        datatype: &#39;json&#39;,
        mtype: &#39;GET&#39;,
        colNames:[&#39;ID&#39;, &#39;User&#39;],
        colModel :[ 
            {name:&#39;id&#39;, jsonmap: &#39;cell.id&#39;, sorttype:&#39;int&#39;},
            {name:&#39;user&#39;, jsonmap: &#39;cell.user&#39;, sorttype:&#39;text&#39;},            
        ],
        jsonReader: { repeatitems: false },
        pager: &#39;#mypager&#39;,
        viewrecords: true,
        rowNum:30,
        rowList:[30,100,1000],
        gridview: true,
        viewrecords: true,
        sortable:true,        
        sortorder: &#39;desc&#39;,        
        height: "100%",
        scrollOffset:0,  
        onSelectRow: function(id){ 
         },          
        altRows     : true,
        altclass    : &#39;oddRow&#39;,
        gridComplete: function() {
            $(".jqgrow:odd").hover(
                function() { $(this).removeClass("oddRow");}, 
                function(event) { $(this).addClass("oddRow");}
            );
        }, 
        onPaging: function() {
            $("#mygrid").setGridParam({datatype:&#39;json&#39;});
            $("#mygrid").trigger("reloadGrid");
            },               
        loadComplete: function () {        	
        	$("#mygrid").setGridParam({datatype:&#39;local&#39;});
        	$("#mygrid").trigger("reloadGrid");
        	}, 	
      }); 
      
      $(&#39;#mygrid&#39;).jqGrid(&#39;filterToolbar&#39;, { searchOnEnter: true, enableClear: false });
    });
</pre>
]]></description>
        	        	<pubDate>Wed, 30 Nov 2011 06:16:02 +0200</pubDate>
        </item>
        <item>
        	<title>kishore on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25235</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p25235</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>Hope u guys have been rocking for jqgrid.</p>
<p>Here it is, my requirenment is about the client side paging.</p>
<p>Is there a way to do a client side paging when we go for loadonce:true?</p>
</p>
<p>thanx in advance, kishore.</p>
]]></description>
        	        	<pubDate>Thu, 24 Nov 2011 09:27:29 +0200</pubDate>
        </item>
        <item>
        	<title>dinesh on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p24331</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p24331</guid>
        	        	<description><![CDATA[<blockquote>
<p>tony said:</p>
<p>Hello,</p>
<p>The solution is a little tricky.</p>
<p>1. Set your default datatype to json or xml.</p>
<p>2. define loadComplete event like this</p>
<p>loadComplete: function () {</p>
<p>$("#mygrid").setGridParam({datatype:&#39;local&#39;});</p>
<p>}</p>
<p>3. define onPaging event like thiss</p>
<p>onPaging : function(which_button) {</p>
<p>$("#mygrid").setGridParam({datatype:&#39;json&#39;});</p>
<p>}</p>
</p>
<p>Enjoy!</p>
<p>Do not forget to set sorttype in colModel in order to sort work correct</p>
<p>Regards</p>
<p>Tony</p>
</blockquote>
<hr />
<p>Thanks, this works for me!</p>
]]></description>
        	        	<pubDate>Thu, 18 Aug 2011 02:45:04 +0300</pubDate>
        </item>
        <item>
        	<title>pupian on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p11184</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p11184</guid>
        	        	<description><![CDATA[<p>this topic solves my problem in my school project.. thank you very much. i wish someday i could be as good as you guys.</p>
]]></description>
        	        	<pubDate>Wed, 28 Oct 2009 09:46:43 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p9548</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p9548</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Not sure if this will be default. In this case the developers should place additional the sorttype option and etc.</p>
<p>Also it is good that you have to do this with minimal code.</p>
<p>The main concept of jqGrid is not to give ready solutions, but rather possibility to do evrething what you want.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 10 Sep 2009 04:11:03 +0300</pubDate>
        </item>
        <item>
        	<title>Jay on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p9495</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p9495</guid>
        	        	<description><![CDATA[<p>It seems to me that this should be the default behavior of jqGrid. Why do you want the latency and performance hit of a round trip to the server just to sort data? Perhaps there should be an option to allow server-side sorting for those that need it, but by default, the client should sort.</p>
<p>Also, I tried using Tony&#39;s suggestions above (toggling the grid between local and xml) and while they seemed to work, I had major problems. On some of the grid pages (maybe just the last page?), when sorting, the columns would become different sizes than the headers. I also encountered an issue where I clicking on the next button in the pager took me back several pages. But then clicking again would start to advance me in the right direction. I finally had to give up.</p>
]]></description>
        	        	<pubDate>Tue, 08 Sep 2009 18:35:30 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p7597</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p7597</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>The on pagging event have the same place - in jqGrid parameters</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 02 Jul 2009 02:48:01 +0300</pubDate>
        </item>
        <item>
        	<title>riverguardian on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p7552</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p7552</guid>
        	        	<description><![CDATA[<p>Would it be possible to elaborate on this? I understand that the loadComplete: function has to be included in the</p>
<p><span class="sfcode">jQuery("#list2").jqGrid({ </span></p>
<p>section, but I&#39;m not sure about what needs to be modified in the onPaging part. Can someone provide me with an example?</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Tue, 30 Jun 2009 09:27:48 +0300</pubDate>
        </item>
        <item>
        	<title>sam1980s on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p6897</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p6897</guid>
        	        	<description><![CDATA[<p>Thanks Tony.</p>
<p>This solution worked.</p>
<p>Regards,</p>
<p>Sam</p>
]]></description>
        	        	<pubDate>Tue, 26 May 2009 01:46:28 +0300</pubDate>
        </item>
        <item>
        	<title>sam1980 on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p6890</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p6890</guid>
        	        	<description><![CDATA[<p>Thanks Tony for your help.</p>
</p>
<p>I will try this out and let you know if it works.</p>
</p>
<p>Regards,</p>
</p>
<p>Sam</p>
]]></description>
        	        	<pubDate>Mon, 25 May 2009 13:50:37 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Using Client Side Sorting But Server Side Paging using JQGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p6889</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid#p6889</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>The solution is a little tricky.</p>
<p>1. Set your default datatype to json or xml.</p>
<p>2. define loadComplete event like this</p>
<p>loadComplete: function () {</p>
<p>$("#mygrid").setGridParam({datatype:&#39;local&#39;});</p>
<p>}</p>
<p>3. define onPaging event like thiss</p>
<p>onPaging : function(which_button) {</p>
<p>$("#mygrid").setGridParam({datatype:&#39;json&#39;});</p>
<p>}</p>
</p>
<p>Enjoy!</p>
<p>Do not forget to set sorttype in colModel in order to sort work correct</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 25 May 2009 12:58:36 +0300</pubDate>
        </item>
</channel>
</rss>