Error occurs plz solve..
Error occurs plz solve..
I'm trying to implement CRUD operation using datatableseditor using Backbone, RequireJS and Datatables.But I'm getting the error message:
$.fn.dataTable.Editor is not a constructor":
why it occurs..what is the reason???
Here is my code...
var editor;
$(document).ready(function () {
editor = new $.fn.dataTable.Editor({
ajax: "/View/GetList",
table: "#sellertable",
fields: [{
label: "SELLER CODE:",
name: "Sellercode"
}, {
label: "EMAIL:",
name: "Email"
}, {
label: "MOBILE:",
name: "Mobile"
}, {
label: "ISACTIVE:",
name: "Isactive"
}
]
});
$('#sellertable').DataTable({
ajax: {
url: "/View/GetList",
type: "POST",
datatype: "json"
},
serverSide: true,
columns: [
{ data:"Sellercode"},
{ data: "Email" },
{ data: "Mobile" },
{ data: "Isactive" }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
});
});
Replies
It sounds like the
dataTables.editor.js
file hasn't been included on your page. Have you downloaded the trial package and included Editor?Allan
dataTables.editor.min.js:1 Uncaught ReferenceError: define is not defined
at dataTables.editor.min.js:1
at dataTables.editor.min.js:1
(anonymous) @ dataTables.editor.min.js:1
(anonymous) @ dataTables.editor.min.js:1
editor.bootstrap.min.js:5 Uncaught TypeError: Cannot read property 'defaults' of undefined
at editor.bootstrap.min.js:5
at editor.bootstrap.min.js:5
at editor.bootstrap.min.js:5
(anonymous) @ editor.bootstrap.min.js:5
(anonymous) @ editor.bootstrap.min.js:5
(anonymous) @ editor.bootstrap.min.js:5
jquery-3.3.1.js:3818 jQuery.Deferred exception: $.fn.dataTable.Editor is not a constructor TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (http://localhost/ssp/demo:166:14)
at mightThrow (https://code.jquery.com/jquery-3.3.1.js:3534:29)
at process (https://code.jquery.com/jquery-3.3.1.js:3602:12) undefined
jQuery.Deferred.exceptionHook @ jquery-3.3.1.js:3818
process @ jquery-3.3.1.js:3606
setTimeout (async)
(anonymous) @ jquery-3.3.1.js:3640
fire @ jquery-3.3.1.js:3268
fireWith @ jquery-3.3.1.js:3398
fire @ jquery-3.3.1.js:3406
fire @ jquery-3.3.1.js:3268
fireWith @ jquery-3.3.1.js:3398
ready @ jquery-3.3.1.js:3878
completed @ jquery-3.3.1.js:3888
jquery-3.3.1.js:3827 Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (demo:166)
at mightThrow (jquery-3.3.1.js:3534)
at process (jquery-3.3.1.js:3602)
please help
This thread here may help...