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

Derek Pollard
  • 6,953
  • 6
  • 39
  • 59
TED
  • 1,829
  • 5
  • 18
  • 36

1 Answers1

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.

donaier
  • 666
  • 6
  • 2
  • 7
    Similar issue for me, but my table had more data columns `td` than header columns `th`. – steakchaser Jul 11 '14 at 05:07
  • 3
    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. – Steve Johnson Aug 11 '14 at 11:45
  • Wow, thanks to steakchaser, that was my problem too. Hurrah! – chris_k Mar 09 '16 at 02:48