Hello,
I’m using dialog layout to separe sections based in differents Tables.
So the main table (user), use on_insert event; then on_after_insert to finish the insert operation for other 4 tables relateds by ID.
How to use it, looking that fields of the other 4 tables are not present in the main table (user)?
Regards
Hello,
If you on_insert table is set with 3rd param to false, e.g.
$e[“on_insert”] = array(“add_client”, null, false);
Then, you can get inserted ID using:
$insert_id = $grid->execute_query($sql,false,”insert_id”);
and move all code of after_insert in same on_insert callback.
If you are using on_insert with 3rd param to true, then in after_insert you will get the inserted ID in $data param.
With the first column already filled with new id. e.g.
Refer: https://www.phpgrid.org/demo/demos/editing/custom-events.phps Line 140