1

Possible Duplicate:
jqgrid client side sorting with server side paging - data disappears

I'm trying to get the sorting to be done on the client side but the paging on the server side. I try to follow this but it's not working for me http://www.trirand.com/blog/?page_id=393/help/using-client-side-sorting-but-server-side-paging-using-jqgrid/#p25269

I'm on version 4.2.0

    $(document).ready(function(){
  $("#mygrid").jqGrid({
    url:'http://localhost/data',
    datatype: 'json',
    mtype: 'GET',
    colNames:['ID', 'User'],
    colModel :[ 
        {name:'id', jsonmap: 'cell.id', sorttype:'int'},
        {name:'user', jsonmap: 'cell.user', sorttype:'text'},            
    ],
    jsonReader: { repeatitems: false },
    pager: '#mypager',
    viewrecords: true,
    rowNum:30,
    rowList:[30,100,1000],
    gridview: true,
    viewrecords: true,
    sortable:true,        
    sortorder: 'desc',        
    height: "100%",
    scrollOffset:0,  
    onSelectRow: function(id){ 
     },          
    altRows     : true,
    altclass    : 'oddRow',
    gridComplete: function() {
        $(".jqgrow:odd").hover(
            function() { $(this).removeClass("oddRow");}, 
            function(event) { $(this).addClass("oddRow");}
        );
    }, 
    onPaging: function() {
        $("#mygrid").setGridParam({datatype:'json'});
        $("#mygrid").trigger("reloadGrid");
        },               
    loadComplete: function () {         
        $("#mygrid").setGridParam({datatype:'local'});
        $("#mygrid").trigger("reloadGrid");
        },  
  }); 

  $('#mygrid').jqGrid('filterToolbar', { searchOnEnter: true, enableClear: false });
});
Community
  • 1
  • 1
user391986
  • 29,536
  • 39
  • 126
  • 205
  • What is your question? What is exactly not work? The test data which return the server could be helpful to understand your problems. – Oleg Nov 30 '11 at 10:08

1 Answers1

1

From that linked discussion thread - it appears you are missing "loadonce : true"

Jake Feasel
  • 16,785
  • 5
  • 53
  • 66