Data Table Error :: Cannot read property 'fnSetData' of undefined
Asked Answered
L

1

23
Initial code looks like this..

var oTable = $('#sim_data').dataTable( {
    aoColumns: [ {"sName": "ss" },{"sName": "sim_no"}, {"sName": "sale_price"}, {"sName":   "purchased_price"},{"sName": "status"} ]

}).makeEditable({ 

    .....       
});

Only when I try to initialize aoColumns as above returns error

Cannot read property 'fnSetData' of undefined

and with out this initialization it works

Leprose answered 21/4, 2014 at 3:27 Comment(0)
M
65

I had the same problem today. Make sure the number of elements in your "aoColumns" matches the number of columns you actually have in your table.

In my case, that was the problem.

Muskmelon answered 23/4, 2014 at 11:27 Comment(3)
Similar issue for me, but my table had more data columns td than header columns th.Etsukoetta
I had the exact same problem. I had 7 columns of data with 6 columns of header column, one set with colspan=2. Fixed it by adding another header column and setting display:none;. May not be the ideal approach but it worked for me.Rathbun
Wow, thanks to steakchaser, that was my problem too. Hurrah!Boredom

© 2022 - 2024 — McMap. All rights reserved.