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