Hi,
I have recently upgraded to v2.0 of the grid and I am trying to use the on_delete function to do a soft-delete instead (i.e., an update) when clicked.
When I run this code and click delete, the delete box just keeps showing and doesn't do anything – it just hangs.
Here is the code.
//Events
$e["on_delete"] = array("delete_deactivate", null, false);
function delete_deactivate($data)
{
print_r();
global $grid;
$DeactiveQuery = "UPDATE schedule SET state ='I' WHERE scheduleid = {$data["scheduleid"]}";
$grid->execute_query($DeactiveQuery);
}
$g->set_events($e);
Where scheduleid is the name of the field in the database.
Thank you – Greg.
1 Answers
Your Answer