Conditional format on detail grid based on master grid

QuestionsConditional format on detail grid based on master grid
Glenn asked 10 years ago

Hi

I tried the below to highlight a detail row that has the same phone# as the master but it did not have any effect. Is this possible?
In the master I have
$agrid_options["subgridparams"] = "phone,street";

In detail I have
$id = intval($_GET["rowid"]);
$master_phone = intval($_GET["phone"]);
$aformat = array();
$aformat["column"] = "phone";
$aformat["op"] = "eq";
$aformat["value"] = "{$master_phone}";
$aformat["css"] = "'background-color':'teal'";
$aformat_all[] = $aformat;
$ogrid->set_conditional_css($aformat_all);

Thanks
Glenn

4 Answers
Abu Ghufran answered 10 years ago

Your code seems fine. If you have some online link to see the problem, please share it.
You can also email me at [email protected]

Glenn answered 10 years ago

Thanks Abu,

He is a link to the problem. I updated the master-detail example. Added code and the field sex to the detail database.
http://websalesdesign.com/proj/lib/phpgrid-full/demos/master-detail/master-detail.php

Glenn

Abu Ghufran answered 10 years ago

Hello,

Following changes will make it functional.
Code: http://hastebin.com/fahefihuwi.php

line 94: Added a new field master_gender with constant value of $gender
$grid->select_command = "SELECT id,client_id, sex, '$gender' as master_gender, invdate,amount,tax,note,total,'$company' as 'company' FROM invheader WHERE client_id = $id";

line 128: Use constant column data
$col["name"] = "master_gender";

line 185: set virtual column in formatting
$aformat["value"] = "{master_gender}";

Glenn answered 10 years ago

Thanks Abu,
This works perfectly!
Regards,
Glenn

Your Answer

12 + 12 =

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?