DataTables----Cannot read property 'length' of undefined


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":[
    {"":"",
    "":"",
     "":""
    },
    {"":"",
    "":"",
     "":""
    }
]

最后注意,返回值實體 Result.data = EntityList。 要放在名為data的字段里。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM