Error help please - Uncaught TypeError: Cannot read property 'mData' of undefined

Error help please - Uncaught TypeError: Cannot read property 'mData' of undefined

SunnyLoSunnyLo Posts: 1Questions: 1Answers: 0
edited March 2020 in Free community support

I'm currently getting an error of

Uncaught TypeError: Cannot read property 'mData' of undefined
at HTMLTableCellElement.<anonymous> (jquery.dataTables.js:1171)
at Function.each (jquery-1.11.3.min.js:2)
at m.fn.init.each (jquery-1.11.3.min.js:2)
at HTMLTableElement.<anonymous> (jquery.dataTables.js:1168)
at Function.each (jquery-1.11.3.min.js:2)
at m.fn.init.each (jquery-1.11.3.min.js:2)
at m.fn.init.DataTable [as dataTable] (jquery.dataTables.js:869)
at m.fn.init.$.fn.DataTable (jquery.dataTables.js:15163)
at HTMLDocument.<anonymous> (runner:2)
at j (jquery-1.11.3.min.js:2)

And here is the test case: http://live.datatables.net/yekoqaxu/1/edit
How do I solve the error?
(The table is generated by the server which I don't have access to)

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    When you use columns, you need one for each column defined - you've got two columns, but only one entry for columns. You can either add another, or use columnDefs, like your updated example here.

    Colin

This discussion has been closed.