Datatable editor buttons not working
Datatable editor buttons not working

I'm trying to run an inline editable table with the following code:
var editor;
editor = new $.fn.dataTable.Editor( {
table: '#' + this.datatable_id,
idSrc: "id",
fields: [ {
label: "Email:",
name: "email"
}, {
label: "First:",
name: "first"
}, {
label: "Last:",
name: "last"
}, {
label: "Gender:",
name: "gender"
}, {
label: "Phone:",
name: "phone"
}
]
} );
$('#' + this.datatable_id).on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this );
} );
$.fn.dataTable.ext.errMode = 'none';
this.datatable = $('#' + this.datatable_id).DataTable({
dom: 'lrtip',
"paging": false,
"info": false,
"scrollY": "480px",
"scrollCollapse": true,
"columns": this.columns[columns_index],
"language": {
"emptyTable": "Faz upload do csv/excel para ver o conteúdo."
},
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
});
var columns = this.columns[columns_index];
var columns_parsed = [];
columns.forEach(function (element) {
columns_parsed.push(element["title"]);
});
this.datatable_columns = columns_parsed;
$('#' + this.datatable_id).on('error.dt', function (e, settings, techNote, message) {
console.log("error:" + message);
this.datatable.clear();
});
I'm getting the following error:
Cannot extend unknown button type: create
I have all the files has I've built it using https://datatables.net/download/.
If I remove this:
````
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
```
It works ok.
This discussion has been closed.
Answers
Hi @fabiofacir,
That would suggest it isn't seeing the Editor source files. Do you have a trial or a license copy of the library? Can you confirm you're including it, please.
Cheers,
Colin