Friday, 6 September 2013

jqgrid Uncaught TypeError: Cannot read property 'stype' of undefined

jqgrid Uncaught TypeError: Cannot read property 'stype' of undefined

Setup: jqGrid 4.4.1
I have a grid that has worked forever. Something has changed and the data
will no longer display in the grid. The grid loads, but sticks with the
"Loading..." notice.
There error message is:
Uncaught TypeError: Cannot read property 'stype' of undefined
(jquery.jqGrid.src.js:1599)
$.fn.jqGrid.each.addLocalData jquery.jqGrid.src.js:1599
$.fn.jqGrid.each.populate jquery.jqGrid.src.js:1853
(anonymous function) jquery.jqGrid.src.js:2467
f.event.dispatch jquery.min.js:3
f.event.add.h.handle.i jquery.min.js:3
f.event.trigger jquery.min.js:3
(anonymous function) jquery.min.js:3
e.extend.each jquery.min.js:2
e.fn.e.each jquery.min.js:2
f.fn.extend.trigger jquery.min.js:3
$gridManager.addColumnNameToGroupHead gridManager.js:81
$gridManager.setGridOptions gridManager.js:28
$order.showOrders orders.js:112
$.ajax.success orders.js:145
f.Callbacks.o jquery.min.js:2
f.Callbacks.p.fireWith jquery.min.js:2
w jquery.min.js:4
f.support.ajax.f.ajaxTransport.send.d jquery.min.js:4
As far as I can tell, the json strings are valid and correct, the data
(and column names) match, and all the stype values are valid.
var searchResultGrid = jQuery("#orderStatus").jqGrid({
datatype: "jsonstring",
datastr: orderData,
jsonReader: { root: 'rows', total: 'total', page: 'page', records:
'records', repeatitems: false, id: 'id' },
colNames: colNames,
colModel: colModel,
rowNum: 5000,
height: $(window).height() - 205,
width: $(window).width()-29,
pagination: true,
pager: '#orderStatusPager',
viewrecords: true,
sortname: 'status',
sortorder: 'desc',
loadonce: true,
sortable: true,
ignoreCase: true,
emptyDataText: "No orders found",
grouping: true,
groupingView: groupingView,
onSelectRow: function (rowId, status) {
{REMOVED FOR CLARITY}
},
loadComplete: function () {
jQuery("#orderStatus").trigger("reloadGrid"); // Call to fix
client-side sorting
$gridManager.setGroupingDd("orderStatus", "orderStatusPager",
groupCol, ["part_no", "Descript"], "status");
if (orderId) {
jQuery("#orderStatus").setSelection(orderId, true);
}
},
resizeStop: function () { $gridManager.updateGrid("orderStatus",
"orderStatusPager"); }
});
I can provide the colNames and colModel if they are relevant to finding
the problem.
What would cause this? Or, how do I go about finding the cause?

No comments:

Post a Comment