Saving

QuestionsSaving
David Mills asked 6 years ago

Hi All
First, This is AWESOME!

I am trying to save to a table.
I have a master grid and a detail grid.
The master grid saves perfectly.
The issue is the child/detail grid.
it uses this code…

$e["on_insert"] = array("add_member", null, true);
$grid->set_events($e);

function add_member(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["FamilyIDFK"] = $id;
}

I can't find an example so I'm asking.
I need to save the client_id which is pulled from a session.
Right now, it saves the FamilyIDFK as a 1 but it souuld puul the FamilyID used
in the Master grid.
Im using…

// receive id, selected row of parent grid
$id = intval($_GET["rowid"]);
$address = $_GET["Address1"];
$city = $_GET["City"];
$cid = intval($_GET["FamilyID"]);

…to pull the row number and $id seems to word (my sql statement likes it),
but when I save in the child table, the $id seems to be reset to 1.

How do I fix this?

2 Answers
David Mills answered 6 years ago

Ok,
I figures out how t save

function add_member(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["Person"] = $id;
$data["params"]["client_id"] = $_SESSION['client'];
$mid = intval($_GET["rowid"]);
$data["params"]["FamilyIDFK"] = $mid;
}

but How do I save data grabed for the masteer grid?
FamilyIDFk is FamilyID used in the master grid not the child so
inteval($_GET["rowid"}) is returning the wrong value.

Abu Ghufran answered 6 years ago

I am emailing you latest build and demo, that insert client_id from master in detail grid addition.

Your Answer

1 + 19 =

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

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

Let us improve this post!