HI,
I need to add assistant, update the options of the select with a list of all assistant available dynamically,
I'm building the editor, calling in ajax the list of assistant, and updating select options after create the editor.
All work except when i'm submit informations, i'm loosing the Staff information in POST element send.
Can you help me to understand ?
$('#assitant').on( 'click', function (e) {
e.preventDefault();
var options = [];
$.ajax({
...
success: function (json) {
options = JSON.parse(json);
editor
.create(
"New assistant",
{ "label": "New assistant", "fn": function () { editor.submit() } }
)
.field('staff').update(options);
}
});
});
editor = new $.fn.dataTable.Editor( {
ajax: 'staff.php',
fields: [
...
{
label: "Assistant",
name: "staff",
type:"select",
options: []
},
...
]
});
}
Regards,