I am currently using datatable on the page. However, when I try to add a datatable plug-in editor, I get errors in the console:
TypeError: $.fn.dataTable.Editor is not a constructor
All I did was add the following lines in jquery to create the table:
var table = $('#sampledt').DataTable(); var editor = new $.fn.dataTable.Editor(table); new $.fn.dataTable.Buttons( table, [ { extend: "edit", editor: editor }, { extend: "remove", editor: editor } ]); table.buttons().container() .appendTo( $('col-sm-6:eq(0)', table.table().container() ));
These are: .js and .css on the page:
jquery-1.12.0.min.js bootstrap.min.js jquery.dataTables.min.js dataTables.bootstrap.min.js dataTables.buttons.min.js buttons.bootstrap.min.js dataTables.select.min.js dataTables.editor.min.js bootstrap.min.css dataTables.bootstrap.min.css buttons.bootstrap.min.css select.bootstrap.min.css editor.bootstrap.min.css
Am I missing something? Thanks in advance.
UPDATE:
I added the editor var = new $ .fn.dataTable.Editor (table); Failed to remove console editor error. Instead, a new error occurred: $ .fn.dataTable.Editor is not a constructor.
UPDATE:
I removed bootstrap.min.js from the page. The console error "TypeError: a.Editor is undefined" has been deleted.
source share