Get information about the line the user delete
Get information about the line the user delete
Hi,
I need to get the information on the line the user selected to delete so rather saying "Are you sure you wish to delete 1 row?" say, for example, "Are you sure you wish to delete the user named John?"
And more, to do something like:
if ( isset( $_POST['action'] ) && $_POST['action'] === 'delete' )
{
$query="INSERT INTO Logs SET LOG="User with ID:".$_POST['data']['IDUser']." Have been deleted";
$db->sql($query);
}
How can I do this?
I need to get the information on the line the user selected to delete so rather saying "Are you sure you wish to delete 1 row?" say, for example, "Are you sure you wish to delete the user named John?"
And more, to do something like:
if ( isset( $_POST['action'] ) && $_POST['action'] === 'delete' )
{
$query="INSERT INTO Logs SET LOG="User with ID:".$_POST['data']['IDUser']." Have been deleted";
$db->sql($query);
}
How can I do this?
This discussion has been closed.
Replies
So the way you would do this is using the `remove()` API: http://editor.datatables.net/api/#remove . Specifically you might have something like:
[code]
var data = table._('tr.DTTT_selected');
editor.message( "Are you sure you wish to delete the user named "+data[0].name+"?" );
editor.remove( row_to_delete, 'Delete row', {
"label": "Confirm",
"fn": function () { this.submit(); }
} );
[/code]
where `table` is the DataTable instance and `editor` is the Editor instance.
Regards,
Allan