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 >> http://chiringuitoweb.com/zonaprivadatdg/socis_table.txt
Can you help me please?
Thank you very much. Sebastian.
Sorry i'm not used pastebin, i don't see the instructions! Attach in this post url of the same code in pastin:
File: http://pastebin.com/mhDDWAw3
thanks!Sebastián.
Hi,
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.
Docs:
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.
Thanks for support!
Other question. Can you see the array $data in funcition on event.
For example
function update_soci($data){
print_r($data);
}
I don't see any echo, print_r, not works!! I need activate debug or other feature! Thanks!