I am using the PHP template from Avant (http://avant.redteamux.com/tables-editable.php) to create an Editable Table where you select a row in the table and when you click on the Edit button, a popup window appears with the fields from this row. I am trying to add backend code for this that calls a web service to update the database. The stage I am at is, on clicking the Edit button, the popup window appears as expected, I can edit the fields and the call to the web service is successfull. My main issue is how to close the popup window after that and have the updates reflected in the table. My code is:
// editor is successfully initialized with jsondata
var table = $('#editable').dataTable({
"sDom":"<'row'<'col-sm-6'T><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
"aaData":jsondata,
"bServerSide": false,
"bAutoWidth": false,
"bDestroy": true,
"aoColumns":columnsjson,
"oTableTools":{
"sRowSelect":"multi",
"aButtons":[
{ sExtends:"editor_create", editor:editor },
{ sExtends:"editor_edit", editor:editor,
"formButtons": [
{
label: "Update",
className: "btn-primary btn",
fn: function (e) {
// Code to call the service: this is successfull
// This is what I need to figure out, I've tried: editor.submit(); | $(this).close();
// (I tried several alternates for "this")
}
}
]
},
{ sExtends: "editor_remove", editor: editor }
});
Thanks.