Trying to setup editor for the first time, getting Cannot read property 'oFeatures' of undefined
Trying to setup editor for the first time, getting Cannot read property 'oFeatures' of undefined
cusco
Posts: 4Questions: 1Answers: 0
Hi,
This is my first attempt at editor, and I've set up a working example of datatables. Then I add editor code, still good. When I call editor.create() I get Cannot read property 'oFeatures' of undefined
here is my current code:
editor = new $.fn.dataTable.Editor({
ajax: "a.php",
table: "#contactlist",
fields: [
{label: 'teste1', name: 'exten'},
{label: 'teste2', name: 'name'}
]
});
oTable = $('#contactList').dataTable({
"dom" : 'T<"clear">lfrtip',
"tableTools" : "swf/copy_csv_xls_pdf.swf",
"aaSorting" : [ [1,'asc'] ],
"bProcessing" : true,
"lengthMenu" : [ [50, 100, 500, -1], [50, 100, 500, "All"] ],
"stateSave" : true,
"bStateSave" : true,
"ajax": {
url: 'getDetails.php',
type: 'POST',
dataType: 'json',
cache: 'false',
data: {action: 'contactList'},
dataSrc: "results"
},
aoColumns: [
{"data": "exten"},
{"data": "name"},
],
"drawCallback": function( settings ) {
$('.toActivate').off('click');
$('.toDeactivate').off('click');
// button click bindings
$('.toActivate').on('click', function(e){
ext = this.id.split('_');
ext = ext[1]; // exten
activate(ext);
});
$('.toDeactivate').on('click', function(e){
ext = this.id.split('_');
ext = ext[1]; // exten
deactivate(ext);
});
}
}); //.api();
What am I doing wrong?
This discussion has been closed.
Answers
and
There is a difference in the capitalisation of the
L
.Allan
Thank you so much Allan
I did look at that but I overlooked it it seems, I tried to check it was the same table name etc.
I feel dumb now.
Thank you!
No worries - a second pair of eyes can often help
Allan
I probably should start a new question, but not sure if I can ask here, because I'm following the same code.
I am using tabletools plugin to export csv, xls etc. So I already have a few buttons and a swf that does this.
However adding buttons for editor (create, edit, remove) does nothing
I added:
to the oTable dataTable({options})
What would I need to make the editor buttons show?
Use the
dom
option to include theB
option to tell DataTables where to put the buttons.Allan