DataTables Editor must be initialised as a 'new' instance' Error Fix?
DataTables Editor must be initialised as a 'new' instance' Error Fix?
HI, I have been using the DataTables plugin for a while and am currently trying out the Editor trial before potentially upgrading. After adding all the editor files to my project, initializing the table now generates the error 'DataTables Editor must be initialized as a 'new' instance''.
After seeing this I changed my init code from:
var table = $('#Shifts').dataTable.Editor ...
to this:
var table = new $('#Shifts').dataTable.Editor ...
However this is still returning the same error and I can't find any info for it on the forums or docs.
Thanks in Advance for any suggestions.
This question has an accepted answers - jump to answer
Answers
Editor initialization is a separate issue from that of DT. See the docs:
https://editor.datatables.net/examples/simple/simple.html
Ahh, I see now, thanks for the pointer @tangerine.
I never thought of it before, but you could use:
But that seems a little redundant compared to
new $.fn.dataTable.Editor(...);
. Personal preference perhaps!Allan