В нашей сетке не определено sortName
или sortOrder
, но в первом столбце отображается значок сортировки (в порядке ASC). Как можно предотвратить появление значка сортировки?
Обновление : код ниже
$("#list").jqGrid({
url:'NoData.json',
datatype: 'json',
mtype: 'GET',
colNames:['Product', 'Type','Expiry', 'Put Call', 'Strike', 'Account','Long','Short', 'Open Qty', 'LTD', 'Operations'],
colModel :[
{name:'product', index:'product', width:75},
{name:'type', index:'type', width:50, align:'right'},
{name:'expiry', index:'expiry', width:60, align:'right'},
{name:'putCall', index:'putCall', width:65},
{name:'strike', index:'strike', sorttype: 'float', width:70},
{name:'account', index:'account', width:70},
{name:'long', index:'long', sorttype: 'int', width:55, align:'right'},
{name:'short', index:'short', sorttype: 'int', width:55, align:'right'},
{name: 'openQty', index:'openQty', width:80, align:'center', sortable:false, search:false, formatter:closeoutFormatter},
{name:'LTD', index:'LTD', width:65, align:'right'},
{index:'operations', width:105, title:false, search:false, align: 'center', formatter:opsFormatter, sortable:false}
],
onPaging: function (b) {
var nextPg = $("#list").getGridParam("page");
if (dirty == 'false') {
currPg = nextPg;
return;
}
$( "#dialog-confirm" ).dialog({
resizable: false,
height:160,
modal: true,
buttons: {
"Stay on current page": function() {
$( this ).dialog( "close" );
},
"Change page": function() {
$( this ).dialog( "close" );
reloadGrid($("#list"), null, nextPg, 'false');
}
}
});
$("#list").setGridParam({page:currPg}); //Workaround - jqGrid still increments the page num even when we return stop so we have to reset it (and track the current page num)
return 'stop';
},
pager: '#pager',
scrollOffset:0, //No scrollbar
rowNum:15,
width:'100%',
viewrecords: true ,
caption: 'Positions',
height: '360',
hidegrid: false //Don't show the expand/collapse button on the top right
}).navGrid("#pager",{edit:false,add:false,del:false,
beforeRefresh: function(){
reloadGrid($("#list"), null, 1, 'true'); //Required so that we go to the server and not reload local data
}
});