In Firefox & IE
, the listing display as expected and default sorting is fine. And No.
column displaying from 1,2,3...
in ascending order
But the problem is in Chrome
and displaying not in order (Please see my below screenshot)
Below is my code and I also tried firstsortorder:'asc'
of relevant column model named lineNo, but it doesn't work.
In fact, it is about 100 records in total.
jQuery.post(jqDataUrl, data, function(response) {
if(response != null) {
jQuery("#jqTable").jqGrid("GridUnload");
jQuery("#jqTable").jqGrid({
data: response.rowdata,
datatype: "local",
colNames:
[
"",
"",
"",
"<spring:message code = "patron.transaction.number" />",
"<spring:message code = "sales.pdtType" />",
"<spring:message code = "sales.pdtDetails" />",
"<spring:message code = "patron.transaction.ticketID" />",
"<spring:message code = "sales.priceCat" />" ,
"<spring:message code = "sales.priceClass" />",
"<spring:message code = "sales.unitPrice" />",
"<spring:message code = "sales.ticketType" />",
"<spring:message code = "sales.dateFulfilled" />",
"<spring:message code = "sales.lastStatus" />",
"<spring:message code = "patron.transaction.lastUpdated" />",
"<spring:message code = "generic.jqgrid.action" />"
],
colModel:
[
{ name: "txnID", index: "txnID", width: 50,hidden:true, editable: true, align: "left" ,search:false,sortable:false},
{ name: "isReturned", index: "isReturned", width: 50,hidden:true, align: "left",title:false,search:false,sortable:false},
{ name: "description", index: "description", width: 50, align: "left",title:false,search:false,sortable:false},
{ name: "lineNo", index: "lineNo", width: 50, align: "left",title:false,search:false,sortable:false},
{ name: "pdtType", index: "pdtType", width: 100, align: "left",title:false,search:false,sortable:false},
{ name: "pdtDetails", index: "pdtDetails", width: 100, align: "left",title:false,search:false,sortable:false},
{ name: "ticketID", index: "ticketID", width: 100,key:true, align: "left",title:false,search:false,sortable:false},
{ name: "priceCat", index: "priceCat", width: 100, align: "left",title:false,search:false,sortable:false},
{ name: "priceClass", index: "priceClass", width: 100, align: "left",title:false,search:false,sortable:false},
{ name: "unitPrice", index: "unitPrice", width: 100, align: "left",title:false,search:false,sortable:false,
formatter:function (cellvalue, options, rowObject) {
if(cellvalue == null || cellvalue == "") {
return "";
} else {
return "${userCurrency}"+parseFloat(cellvalue).toFixed(2);
}
}
},
{ name: "ticketType", index: "ticketType", width: 80, align: "left",title:false,search:false,sortable:false},
{ name: "dateFulFilled", index: "dateFulFilled", width: 80, align: "left",title:false,search:false,sortable:false},
{ name: "lastStatus", index: "lastStatus", width: 80, align: "left",title:false,search:false,sortable:false},
{ name: "lastUpdated", index: "lastUpdated", width: 80, align: "left",title:false,search:false,sortable:false},
{ name: 'action', index: 'action', width: 50, align: "center", sortable: false, search:false}
],
autowidth: true,
height: 'auto',
grouping: true,
groupingView : {
groupField : ['description'],
groupColumnShow : [false, false],
groupText : ["<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>","<b>{0} </b>"],
groupCollapse : false,
groupOrder: ['asc', 'asc'],
},
pager: jQuery("#jqTablePager"),
//rowNum: 10,
rowList: [10, 20, 30],
cmTemplate: { title: false },
emptyrecords:"<spring:message code = 'generic.jqgrid.nosearchresults'/>",
jsonReader : {root: "rowdata", page: "page", total: "total", records: "records", repeatitems: false, id: "ticketID"},
gridComplete: function() {
var grid = jQuery("#jqTable");
var ids = grid.jqGrid('getDataIDs');
for (var i = 0; i < ids.length; i++) {
var row = ids[i];
var isReturned = grid.getCell(row, 'isReturned');
if(isReturned=='true'){
document.getElementById(row).style.backgroundColor='orange';
}
var button = "<img class='icons' title='View Fee Details' src='<c:url value='/resources/img/view.png' />' onclick='viewFeeDetailPopup(" + row + ")'/> <img class='icons' title='View Ticket History' src='<c:url value='/resources/img/lookup2.png' />' onclick='viewTicketHistoryPopup(" + row + ")'/>";
grid.jqGrid('setRowData', row, {action: button});
}
}
});
} else {
jQuery('#statusMsg').html("<fmt:message key="generic.jqgrid.noresponse"/>");
}
});
Any help is appreciated and many thanks!!!