session

Questionssession
David Mills asked 11 years ago

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
}

1 Answers
Abu Ghufran answered 11 years ago

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.

Your Answer

1 + 0 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?