When I update a value in the grid on edit I need to update a field with the value of a users session variable.
I know this doesn’t work but maybe it gives you an idea of what I am trying to do:
//PROCESSED_BY
$col = array();
$col[“title”] = “Processor”; // caption of column, can use HTML tags too
$col[“name”] = “processed_by”; // grid column name, same as db field or alias from sql
$col[“editable”] = true;
$col[“editoptions”][“defaultValue”]=$_SESSION[‘accounts_sak’];
array(“list”=>true, “add”=>false, “edit”=>true, “view”=>true, “bulkedit”=>false);
$cols[] = $col;
Best way to do this is to use on_update event. e.g.
$e["on_update"] = array("update_data", null, true);
$g->set_events($e);
function update_data($data)
{
$data["params"]["processed_by"] = $_SESSION["accounts_sak"];
}
Refer this link for more details:
will that update the field for only the row that I edited? Not the entire table right?