Cannot read property 'length' of undefined
除了網上說的column數量要和一樣外,還有一個,dataTable只接受數組類型的數據.
Array of arrays
data: [
[
"name": "Tiger Nixon1",
"position": "System Architect1",
"phone": { "plain": 5552368, "filter": "5552368 555-2368", "display": "555-2368" ],
"salary": "$3,1201",
"start_date": "2011/04/25",
"office": "Edinburgh1",
"extn": "54211"
],
[
"name": "Tiger Nixon2",
"position": "System Architect2",
"phone": { "plain": 5552368, "filter": "5552368 555-2368", "display": "555-2368" },
"salary": "$3,1202",
"start_date": "2011/04/25",
"office": "Edinburgh2",
"extn": "54212"
],
[
"name": "Tiger Nixon3",
"position": "System Architect3",
"phone": { "plain": 5552368, "filter": "5552368 555-2368", "display": "555-2368" },
"salary": "$3,1203",
"start_date": "2011/04/25",
"office": "Edinburgh3",
"extn": "54213"
]
或者
Array of objects
"data":[
{"":"",
"":"",
"":""
},
{"":"",
"":"",
"":""
}
]