Master Details not finding $id

QuestionsMaster Details not finding $id
Gary Brett asked 10 years ago

Hi Abu, I have taken the master-detail demo and edited with my own code as I have done with several other grids and all worked fine.

However on this grid the detail grid doesn't find the master grids $client_id, that is the primary key in the master query. Pastebin http://pastebin.com/r4J8hbPx

// receive id, selected row of parent grid
$id = intval($_GET["rowid"]);
$client_id = intval($_GET["client_id"]);

When I run my query in detail grid as either WHERE client_id = $id"; or WHERE client_id = $client_id"; it displays all records? Changing that too WHERE client_id = 25"; for example returns the correct row..

I have noticed too that add a new record adds all data except for the client_id to the updated table.. Can you see where it is going wrong if you have 5 minutes, I have rebuilt over and over with no success?

3 Answers
Abu Ghufran answered 10 years ago

Try after removing space b/w "client_id, id".

Use: $opt["subgridparams"] = "client_id,id";

Gary Brett answered 10 years ago

Hi Abu, I removed id as it does not exist in master table and that now loads detail grid correctly but I still cant seem to add the client_id on insert, all other fields are populated so I know the add function works ok.

http://pastebin.com/bRKdrVq9

An odd one?

Gary Brett answered 10 years ago

Fixed it now, changed the insert function to;

function add_lead(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["client_id"] = $id;
$data["params"]["Status"];

Thanks

Your Answer

17 + 20 =

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?