Hide Detail button on View page

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

Hide Detail button on View page

Post by JAW »

Hello,
I need to hide the Detail link to the Detail Table on the View page. I have searched this forum and tried everything I could find but nothing seems to work. I have been able to successfully hide it on the List page with $this->ListOptions->Items["detail_tslrp"]->Visible=False; but not on the View Page. Can anyone please let me know what the syntax is for the same code on the View Page. Here are a couple things I have tried that do not seem to work.

$this->DetailPages->Items["<MyDetailTableName>"]->Visible = FALSE;
$this->DetailPages->Items["detail_<MyDetailTableName>"]->Visible = FALSE;

Thanks
JW


mobhar
User
Posts: 11660

Post by mobhar »

Assume your detail table name is "products", then simply put the following code in "Page_Render" under "View Page" of your master table:

$options = &$this->OtherOptions;
$option = &$options["detail"];
$item = &$option->Add("detail_products"); // adjust "products" to your actual detail table
$item->Visible = FALSE;


arbei
User
Posts: 9288

Post by arbei »

To hide the detail button in View page of the master table, you need to add your code in Page_Render Server Event of the view page in the master table.

For example:
$this->OtherOptions["detail"]->Items["detail_<Detail Table Name>"]->Visible = FALSE;

Read help file topic: "Server Events and Client Scripts" -> "Page_Render" for more information.


Post Reply