Error $.fn.dataTable.Editor is not a constructor
Error $.fn.dataTable.Editor is not a constructor
Mazin
Posts: 6Questions: 1Answers: 1
I have downloaded the trial version of the Editor and trying to implement the same in my project. But I am getting an error $.fn.dataTable.Editor is not a constructor
I have followed the code in the examples and included all the scripts and css files in my system. still it is giving the error. Please help me to fix this asap
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You will have to show your code.
The are the scripts and css i am using and below is my datatable editor code
'''
var editor;
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajax": "/customers",
"table": "#table_id",
"fields": [ {
"label": "Name:",
"name": "name"
}, {
"label": "Address:",
"name": "address"
}
]
} );
$('#table_id').DataTable( {
dom: "Bfrtip",
"ajax": "/customers",
columns: [
{ data: "name" },
{ data: "address" },
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
}); '''
thanks anyways. it is fixed.
This error can often be caused by multiple jQuery version's being loaded on the same page. The later ones will overwrite the earlier ones.
Good to hear you've got it working now - how did you fix it?
Thanks,
Allan
Yes, as you said i was referring to the same js file 2 times, one in the inner page and in layout. One in the inner page i haven't noticed.
Right now I am facing another error Could you help me to figure it out ?
Uncaught TypeError: Cannot read property 'oFeatures' of undefined
'''
var userEditor = new $.fn.dataTable.Editor({
Yeah. Fixed it also..
'''
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]'''
this was the thing caused the issue.
Thanks for posting back. Good to hear you have it working now.
Allan