Events: on_insert, on_update, on_delete

QuestionsEvents: on_insert, on_update, on_delete
Sebastián Esteller asked 5 years ago

Hello friends,
We have a problem with insertion, update or delete data from grid when use events.
For example when use on_update event in grid, this event works correcty but not update record in grid.

The same problem with other operations.

You can see code in this url >>

Can you help me please?
Thank you very much. Sebastian.

4 Answers
Sebastián Esteller answered 5 years ago

Sorry i'm not used pastebin, i don't see the instructions! Attach in this post url of the same code in pastin:



Abu Ghufran answered 5 years ago


The current code:

$e["on_insert"] = array("insert_soci", null, false);
$e["on_update"] = array("update_soci", null, false);
$e["on_delete"] = array("delete_soci", null, false);

Will only execute the code inside function and skip the default grid update/insert routine because the 3rd argument if set to false.

If you want to update with normal grid operation, you need to set 3rd argument to true.


If you pass last argument as true, functions will act as a data filter and insert/update in `->table` will be performed by grid after your function.

Sebastián Esteller answered 5 years ago

Thanks for support!
Other question. Can you see the array $data in funcition on event.

For example

function update_soci($data){

I don't see any echo, print_r, not works!! I need activate debug or other feature! Thanks!

Abu Ghufran answered 5 years ago

try this:

function update_soci($data){
$str = ob_get_clean();

Your Answer

18 + 15 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!