Hi everybody, after one week of search/tests/debugging and headaches... I'm kindly seeking your help on the following problem: Consider the following simple piece of code (I'm focusing on the POST only):
var editor = new $.fn.dataTable.Editor( {
ajax: {
create: {
type: 'POST',
url: '/employees'
},
edit: {
type: 'PUT',
url: 'XXXXXXXX'
},
remove: {
type: 'DELETE',
url: 'XXXXXXXX'
}
},
table: "#example",
fields: [ {
label: "First name:",
name: "first_name"
}, {
label: "Last name:",
name: "last_name"
}, {
label: "Position:"
name: "position"
}
]
} );
$('#example').DataTable( {
dom: "Bfrtip",
ajax: "/employees",
columns: [
{ data: "first_name" },
{ data: "last_name" },
{ data: "position" },
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
==> When I submit the form, it posts empty values for the 3 fields! Do I need to serialize Editor's form fields?
I'm using Laravel as PHP MVC The related "#example" datatables displays data correctly, no problem on that.
Thanks a lot for your help!