我正在尝试使用 jQgrid,但该表无法加载数据。背景中有某种透明的黑色块 UI。我收到的 Json 响应是:
{"total":"1","page":"1","records ":"10",
"rows":[
{"id":"26010","cell":[26010,303,100,""]},
{"id":"26009","cell":[26009,303,100,""]},
{"id":"26008","cell":[26008,303,100,""]},
{"id":"26007","cell":[26007,303,100,""]},
{"id":"26006","cell":[26006,303,100,""]},
{"id":"26005","cell":[26005,303,100,""]},
{"id":"26004","cell":[26004,303,100,""]},
{"id":"26003","cell":[26003,303,100,""]},
{"id":"26002","cell":[26002,303,100,""]},
{"id":"26001","cell":[26001,303,100,""]}]}
这页纸:
<table id="list3"></table>
<div id="pager3"></div>
<table id="navgrid"></table>
<div id="pagernav"></div>
<script>
$(document).ready(function(){
$("#list3").jqGrid({
url:'<%=getForecastedTransactionURL%>',
mtype:'POST',
datatype : 'json',
colNames : [ 'Txn Id', 'Transaction Type', 'Amount', 'Description'],
colModel : [ {
name : 'id',
index : 'id',
sorttype : "int",
hidden:true
}, {
name : 'transactionType',
index : 'transactionType',
width : 100
}, {
name : 'amount',
index : 'amount',
width : 80,
align : "right",
sorttype : "number"
}, {
name : 'description',
index : 'description',
width : 80,
align : "right",
sorttype : "text"
}],
multiselect : true,
rowNum : 20,
rowList : [ 10, 20, 30 ],
pager : '#pager3',
sortname : 'transactionType',
viewrecords : true,
sortorder : "desc",
loadonce : true,
caption : "Load Once Example"
});
});
</script>
我有什么遗漏吗?