title: Clicking a column header displays jqgrid in ascending order
body: <p>Currently i am working in java jqgrid I want to display the sorted grid after clicking of a column header.I already used onsortcol.but it is not working .her is my code.onsort col function is in active but it doesnt performs sorting.thanks in advance</p>
  
  <p>CODE:
  </p>
  
  <pre><code>    jq(function() {
          var base = "&lt;%=request.getContextPath()%&gt;";
          var  records = -1;
          jq("#grid").jqGrid({
          url:base+'/admin/adminusermanagecrud.htm',
          datatype: 'json',
          mtype: 'GET',
          colNames:['', 'Name','Employee ID','User Name','Mobile','City','State','Is Active','Created Date','Role','Bank Name'],
          colModel:[
              {name:'id',index:'id',  width:55,editable:false,hidden:true},
              {name:'adminName',index:'adminName', width:175,editable:true,sortable:true, editrules:{edithidden:true,required:false}, editoptions:{size:25,readonly:false,disabled:false},search:false},
              {name:'adminEmployeeId',index:'adminEmployeeId', width:175,editable:true, editrules:{edithidden:true,required:false}, editoptions:{size:25,readonly:true,disabled:false},search:true},
              {name:'adminuserName',index:'adminuserName', width:175,editable:true, editrules:{edithidden:false,required:false}, editoptions:{size:25,readonly:false,disabled:false},search:true},
              {name:'mobile',index:'mobile', width:175,editable:true, editrules:{edithidden:false,required:false}, editoptions:{size:25,disabled:false},search:true},
              {name:'city',index:'city', width:175,editable:true, editrules:{edithidden:true,required:false}, editoptions:{size:25,disabled:true},search:true},
              {name:'state',index:'state', width:175,editable:true, editrules:{edithidden:true,required:false}, editoptions:{size:25,disabled:true},search:true},
              {width:165,formatter:linkFormat,editable:true,edittype:'select',editrules:{edithidden:true,required:false}, editoptions:{value:"0:Activate;1:De-Activate",size:25,disabled:false,multiple:false},search:false},
              {name:'createDate',index:'createDate',width:185,editable:true, editrules:{edithidden:true,required:false}, editoptions:{size:25,disabled:true},search:false},
              {name:'role',index:'role',width:175,editable:true,editrules:{edithidden:true,required:false},editoptions:{size:25,disabled:true},search:false},
              {name:'bankName',index:'bankName',width:175,editable:true,editrules:{edithidden:true,required:false},editoptions:{size:25,disabled:true},search:false}
  
          ],
  
          postData:{ 
          },
          loadError:function(xhr,status,error)
          {
              var base = "&lt;%=request.getContextPath()%&gt;";
              alert(status);
              if(xhr.status == '403' || xhr.status == '401' || status == 'parsererror')
                  {
                      window.location.href = base+"/login.htm";
                  }
          },
          rowNum:5,
          //rowList:[5,10,15,20],
          height: 150,
          //width:750,
          autowidth: true,
          rownumbers: true,
          pager: '#pager',
          sortname: 'adminName',
          scrollrows:true,
          viewrecords: true,
          sortorder: "asc",
          caption:"Admin Users Summary",
          onSortCol: function (index, columnIndex, sortOrder) {
              alert(index);
              return 'stop';
          },
          cellEdit: false,
          emptyrecords: "Search returned no results",
          loadonce: false,
          loadComplete: function()
          {
          },
          jsonReader : {
              root: function(obj)
              {
                  if(obj.status == false)
                  {
                      window.location.href = base+"/login.htm";
                  }
                  else
                  {
                      records = obj.records;
                      return obj.rows;
                  }
              },
              page: "page",
              total: "total",
              records: "records",
              repeatitems: false,
              cell: "cell",
              id: "id"
          },
          editurl:base+"/admin/edit.htm"
      });
  
      jq("#grid").navGrid('#pager',
              {edit:false,add:false,del:false,search:true,excel:true},
  
              { },
              { },
              { }, 
              { 
                  sopt:['eq','cn', 'bw', 'ew'],
                  closeOnEscape: true, 
                  multipleSearch: false, 
                  closeAfterSearch: true
               }
      );
  
      jq("#btnFilter").click(function()
      {
      jq("#grid").jqGrid('searchGrid',
          {
          multipleSearch: false, 
          sopt:['eq']
          }
          );
      });
  
  });
  </code></pre>