Data Table Error :: Cannot read property 'fnSetData' of undefined

TED picture TED · Apr 21, 2014 · Viewed 25.8k times · Source
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

Answer

donaier picture donaier · Apr 23, 2014

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.