Hide detail table based on master table condition

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
philmills
User
Posts: 574

Hide detail table based on master table condition

Post by philmills »

I have a master table with three detail tables.
the master table contains a select field e.g.:
fieldname "selectDetail"

  • table 1 (value '1')
  • table 2 (value '2')
  • table 3 (value '3')
    when expanding the master row to show the detail tables for the record, I would like to only show the detail table which corresponds to the table selected in "selectDetail".

How can I do that?


mobhar
User
Posts: 11905

Post by mobhar »

That's very easy.

Let's say from demo2024 project, you want to hide orderdetails table if the OrderID field in master record is equal to 11078, then simplly put this following code in ListOptions_Rendering server event that belongs to the List Page of your orders table:

if (!empty($this->OrderID->CurrentValue) && $this->OrderID->CurrentValue == "11078")
    $this->DetailPages->Items["orderdetails"]->Visible = false;
else
   $this->DetailPages->Items["orderdetails"]->Visible = true;

Post Reply