Good Afternoon, Abu.
I have a little problem with an event in a grid, i can get only the editable fields, and the firt col data, this is the code.
$e[“on_update”] = array(“update_terminal”, null, true);
$g->set_events($e);
function update_terminal($data)
{
$term = $data[“Terminal”];
$est = $data[“Establecimiento”];
$bon = $data[“params”][“Bonos”];
$fec = $data[“Fecha”];
global $g;$str = “INSERT INTO journal (Fecha, Terminal,Establecimiento, Descripcion,Notes) VALUES (‘”.date(‘Y-m-d H:i:s’).”‘,’$term’, ‘$est’,’Corregidos Bonos : $bon ‘,’$fec’)”;
$g->execute_query($str);
}
I can get The filed Bonos, beceause is the one i edit, ican get the Terminal, beceause is the first field in the grid, but, how is possible to get the others fields of the selected row if they are not editables?
Thank you very much for your support.
Best regards.
Only editable fields are currently posted back to server. You can put debug function to see the posted $data array.
function update_terminal($data)
{ phpgrid_error($data);
// …
}
What you can do is to execute a sql query and fetch row data from database using first column (id). e.g.
global $g;
$rs = $g->get_one(“….. WHERE ID = $id”);