Hi
I have a master grid that is linked to my detail grid.
the detail grid is setup as an excel SS.
When the user clicks the master SS name, the id is saved to a session ($_SESSION['SheetId'] = $id;)
but when I add records to the detail grid, the session is set back to 0.
Is there a way to put an if statment in there? like
if (grid1 clicked) {
save session
}
Each time when grid1 is clicked, the ID of master grid is passed to detail grid (as $_POST["rowid"])
This rowid can be accessed in on_insert or on_update event.
// detail grid …
$e["on_insert"] = array("add_client", null, true);
$grid->set_events($e);
function add_client(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["client_id"] = $id;
….
}
You can refer demos/master-detail/master-detail.php for working sample code.