Master detail grid

QuestionsMaster detail grid
Mauro asked 11 years ago

Please help me 🙂
I've a table:
TABLE1
– ID
– S_N
– DATE

TABLE2
– ID
– S_N
_ STATUS

For default i've read that is passed the (PK) rowid, how i can pass the S_N?
so i can make a select like this
select * from table2 where table2.s_n = table1.s_n

Thanks

1 Answers
Abu Ghufran answered 11 years ago

In master grid, you can set extra subgrid params in this way.

$opt["subgridparams"] = "s_n";
$grid->set_options($opt)

And in detail grid, you can use that param in sql command.

$sn = intval($_GET["s_n"]);
$grid->select_command = "select * from table2 where table2.s_n = $sn";

Refer demos/master-detail/master-detail.php.

Your Answer

2 + 10 =

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?