Note that there are some explanatory texts on larger screens.

plurals
  1. POjqgrid sort icon on columns are not reset after trigger('reloadGrid') call
    primarykey
    data
    text
    <p>Please see the sample code below. </p> <ul> <li><p>Initially the grid comes up with no sort icon in any of the grid column headers - good. </p></li> <li><p>Click on 'Client' column header to sort the grid. </p></li> <li><p>Click on REFRESH button. It calls grid.trigger('reloadGrid'). </p></li> <li><p>The grid is reloaded but sort icon on 'Client' header is still there. - not so good. </p></li> </ul> <p>`</p> <pre><code> $(function() { var mydata = [ {id:"1", name:"test", amount:"200"}, {id:"2", name:"test2", amount:"300"}, {id:"3", name:"F", amount:"400"}, {id:"4", name:"test4", amount:"200"}, {id:"5", name:"test5", amount:"300"}, {id:"6", name:"test6", amount:"400"}, {id:"7", name:"test7", amount:"200"}, {id:"8", name:"test8", amount:"300"}, {id:"9", name:"test9", amount:"400"}, {id:"10",name:"test10", amount:"500"}, {id:"11",name:"F", amount:"500"}, {id:"12",name:"test11", amount:"500"}, {id:"13", name:"test", amount:"200"}, {id:"14", name:"O", amount:"200"} ]; jQuery("#list").jqGrid({ datatype: "local", data: mydata, width: 700, loadComplete: function() { $(this).setGridParam({sortname: 'id'}); }, colNames:['Inv No','Client', 'Amount'], colModel:[ {name:'id',index:'id', width:65, sorttype:'int', searchoptions:{sopt:['eq','ne','lt','le','gt','ge']}}, {name:'name',index:'name', width:100, searchoptions:{dataUrl:'/api/domains/producttypedomain'}}, {name:'amount',index:'amount', sorttype:'int', width:80, align:"right"} ], rowNum:100, pager: '#pager', height:'auto', viewrecords: true, rownumbers: true, gridview : true, caption:"Advanced Search Example" }); jQuery("#list").jqGrid('navGrid','#pager', { edit:false,add:false,del:false,search:true,refresh:true }, {}, // edit options {}, // add options {}, //del options { multipleSearch:true, overlay:false, recreateFilter:true } // search options ); }); $(function() { $('#refresh-btn').click(function() { jQuery("#list").trigger('reloadGrid'); }); }); </code></pre> <p>`</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload