I’ve been looking through the docs and there are some quick solutions for after update or insert…
Is there a similar function for delete?
I am looking for something like:
$e[“on_after_insert”] = array(“after_insert”, null, false);
If I need to replace the delete button, I could do that as well, but I need to know how I would get my custom function to do a normal delete operation, and then call my custom code afterwards.
First, you can use on_after_delete same way you use on_delete / on_insert or on_after_insert. Difference is delete only gets row id to be deleted as parameter (not whole row data).
And in the callback function, you can write your custom delete logic and then push a message on client side with JS code. e.g.
$g->execute_query(“DELETE FROM …..”);
// first param is message, second is autofade after 1 sec (0/1)
phpgrid_msg(“Record Deleted. <script>alert(‘custom js code’);</script>“,1);
Let me know in case of any query.
Ref Code: https://www.gridphp.com/demo/demos/editing/bulk-edit.phps (line 150)
Abu Ghufran - Dev Team
Grid 4 PHP Framework
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?