jquery - jqgrid onSortCol return 'stop' not able to stop client side sorting -
i having issues onsortcol event of jqgrid.
i trying disable client side sorting , handle on server side. due contraints have use datatype local , not json.
i can see server side call being made , results fetched , getting displayed in ui screen. not able stop client side sorting happening .
return 'stop' not able stop jqgrid performing sorting on newly returned data.
can let me know how stop client side sorting happening here?
here code inside onsortcol function:
// populate data using async call
onsortcol: function (index, columnindex, sortorder) { that.store.find("oldcontact",{page:page,pagesize:pagesize,columnname:index,sortorder:sortorder}).then(function(data){ grid.jqgrid('cleargriddata'); grid.jqgrid('setgridparam', {data: data}); grid.trigger('reloadgrid'); return 'stop'; }); } ,
found solution problem..
just define sorttype return constant value disable client side sorting.
this did trick me:
colmodel:[ {name:'id',index:'id', key: true, width:70,sorttype:"int"}, {name:'firstname',index:'firstname', width:90,sorttype: function () { return 1; // constant value }}, {name:'lastname',index:'lastname', width:100,sorttype: function () { return 1; // constant value }} ]
i continue handle custom sorting inside onsortcol posted above in question....
Comments
Post a Comment