I cant get jqGrid to show any records, my javascript:
jq.getScript("/js/grid.locale-en.js", function(){
jq.getScript("/js/jquery.jqGrid.min.js", function(){
jq(".normalTable").jqGrid({
url:'/xml/results.xml',
mtype: "GET",
datatype: "xml",
colNames: ['Instrument', 'ExpValue', 'BuyerPayout','SellerPayout'],
colModel: [
{ name: 'Instrument', index: 'Instrument', width: 55, xmlmap: "Instrument" },
{ name: 'ExpValue', index: 'ExpValue', width: 80, xmlmap: "ExpValue" },
{ name: 'BuyerPayout', index: 'BuyerPayout', width: 80, xmlmap: "BuyerPayout" },
{ name: 'SellerPayout', index: 'SellerPayout', width: 80, xmlmap: "SellerPayout"}],
pager: '#pager',
rowNum: 10,
rowList: [10, 20, 30],
sortname: 'Instrument',
viewrecords: true,
gridview: true,
autoencode: true,
xmlReader: {
root:"TradingResults",
row:"TradingResult"
},
width: '480'
});
});
});
My XML structure:
<TradingResults>
<DateGroup date="2014-04-24">
<TradingResult>
<Instrument>xyz</Instrument>
<ExpValue>94.65</ExpValue>
<BuyerPayout>0</BuyerPayout>
<SellerPayout>100</SellerPayout>
</TradingResult>
<TradingResult>
<Instrument>xyz</Instrument>
<ExpValue>94.659</ExpValue>
<BuyerPayout>0</BuyerPayout>
<SellerPayout>100</SellerPayout>
</TradingResult>
</DateGroup>
<TradingResults>
No errors in console.
Result: