Link to test case:
Debugger code (debug.datatables.net):
Error messages shown: Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
Description of problem:
I'm trying to figure out the possibility to use DataTables Editor in our project.
We are using the old version jQuery with Bootstrap libraries for our project and tying to accommodate DataTables to the project.
I've installed the datatables.net-editor with the npm packager and updated *.js files with the install.js script from the trial version, downloaded from the website. The trial version not expired yet. I've download it a couple days ago.
I was able to make the DataTable working with the next code:
var $j = jquery.noConflict();
$j(function () {
$j("#datatable-example").DataTable({
ajax: "/data/objects.json",
columns: [
{ data: "name" },
{ data: "position" },
...
{ data: "salary" },
],
});
});
But when I'm trying to use DataTable Editor from an example:
var $j = jquery.noConflict();
$j(function () {
var editor = new $j.fn.dataTable.Editor({
ajax: "/data/datatable-editor-objects.json",
table: "#datatable-editor-example",
fields: [
{
label: "First name:",
name: "first_name",
},
{
label: "Last name:",
name: "last_name",
},
...
{
label: "Salary:",
name: "salary",
},
],
});
, it is throwing the error for me:
"Uncaught TypeError: $j.fn.dataTable.Editor is not a constructor".
From the stack of function invocations I see it is using the proper latest version of jQuery (3.6.0).
Is it issue with the DataTables Editor package or an issue with the jQuery versions compatibility?
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.