How to hide a field on showmaster table

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

How to hide a field on showmaster table

Post by papirri3 »

Example:

I placed the following code on detailtable Page_Redered

if ($this->getCurrentMasterTable() <> "") {
$this->getCurrentMasterTable->site_id->Visible = FALSE;
}

is there a way to do that?


kirondedshem
User
Posts: 642

Post by kirondedshem »

Use the custom template->table specific->master record page->custom template and draw a custom view for the master record where you only include fields you want to show for example
<table>
<tr>
<td>{{{id}}}</td>
<td>{{{name}}}</td>
</tr>
</table>
etc etc

NOTE:this only affects cases where the url is like detail_tablelist.php?showmaster=master_table&fk_id=1, but if you mean on master/detail view/edit then put code in page_rendering of the view/edit page


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Recently I had the same problem, I solved it with the following code:

// Row Rendered event (in Master-Table!!!)
if($this->PageID == "" and CurrentTable()->getCurrentMasterTable() <> "") {
$this->XXX->Visible = FALSE; // replace XXX with your fieldname
}


papirri3
User
Posts: 72

Post by papirri3 »

Both answers work great, thank you


Post Reply