JSON 对象未在 Jquery 数据表中显示。这是我的示例代码:
function getjQueryTable(){
$("#jQueryInvoices").dataTable({
"bServerSide": true,
"sAjaxSource": "/audit/listinvoice.do?action=getInvoices&carrierId=22&customerId=12096&shipperId=-1&status=Open&invoiceNumber=&toDateStr=&fromDateStr=&controlNumber=&runNumber=&dateCriteria=billDate&glCode=-1",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"aoColumns": [
{ "mDataProp": "invoiceNumber" },
{ "mDataProp": "invoiceAmount" },
{ "mDataProp": "contractNumber" },
{ "mDataProp": "status" }
]
});
}
我的服务器响应是:
{ "ResultSet":{"aaData":[{"invoiceAmount":92.67,"sumQty":25,"customerId":12096,"contractId":401,"approvedAmount":0,"checkAmount":0,"createDate":"09/15/2013","invoiceId":9715002,"billDate":"09/16/2013",etc..
我的 HTML 代码是:
<div id="demo_jui">
<table id="jQueryInvoices" class="display">
<thead>
<tr>
<th>Invoice Number</th>
<th>Invoice Amount</th>
<th>Contract Number</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>