My server side can receive new row request, but edit and remove doesn't come through
My server side can receive new row request, but edit and remove doesn't come through
in Editor
I have a very simple flask app set up to test Editor. Right now adding a new row works well, but when I click the edit/remove button, it seems like my backend is not receiving any HTTP request.
Looks like I'm missing something on my client side, can't tell what it is since I basically have the same code as the sample.
Below is my client-side code:
var editor = new $.fn.dataTable.Editor( {
ajax: '/api/staff',
table: '#table_id',
fields: [
{ label: 'First name', name: 'first_name' },
{ label: 'Last name', name: 'last_name' },
// etc
]
} );
$('#table_id').DataTable( {
ajax: '/api/staff',
dom: 'Bfrtip',
columns: [
{ data: 'first_name' },
{ data: 'last_name' },
// etc
],
select: true,
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor }
]
} );
This discussion has been closed.
Answers
Ok I figured it out, you have to have a row identifier in the Ajax load...
(should perhaps add that to the documentation)