1
我有這樣的代碼:JSON源數據表
testdata = [{
"hasresults": true,
"resultscount": 5,
"dob": null,
"chart": {
"rows": [
{
"chart": "BAR000",
"firstname": "RUSSELL",
"lastname": "BARON"
},
{
"chart": "BAR001",
"firstname": "BRUSELL",
"lastname": "BARON"
},
{
"chart": "BAR002",
"firstname": "GARY",
"lastname": "BARON"
}
]
}
}];
$('#test').dataTable({
"aaData": testdata,
"aoColumns": [{
"mDataProp": "chart"
}, {
"mDataProp": "firstname"
}, {
"mDataProp": "lastname"
}]
});
有人可以幫助我這是爲什麼不工作?看來,如果我去掉下面,將工作:
"hasresults": true,
"resultscount": 5,
"dob": null,
"chart": {
嘗試切換' 「DOB」:這對JSON資源類型]:null'到' 「DOB」 empty'見(HTTP:/ /www.tutorialspoint.com/json/json_data_types.htm) – CalebB 2015-03-02 19:31:59
試過但不起作用。我在想mDataProp應該有chart.rows.chart,但它也不起作用。 – aldrin 2015-03-02 20:56:22
它給你的具體例外是什麼? – CalebB 2015-03-02 22:08:59