Hide one or more fields for the master record

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

Hide one or more fields for the master record

Post by justapeek »

Hi all,

I am currently testing a simple master/detail relation to understand how it could be customized.

In particular I'd like to limit the number of fields of the master record shown at top of the details list page.

I can easily limit the number of fields showed in different pages such as [masterTable]list.php (using $this->fieldname->Visible = FALSE in Page_Load) but I cannot do the same in the [detailTable]list.php page with regard to the fields of the master record.

Alternatively, would be better than nothing to reverse the display order: first the grid with detail records, followed by all the fields of the master record. This would avoid having to scroll down the whole page, just to be able to view/edit the detail records.

I have read all the posts about master/detail management, but the few concerning this issue don't seem to give a working solution (or maybe I didn't understand them).

Thanks in advance.


mobhar
User
Posts: 11734

Post by mobhar »

justapeek wrote:
I can easily limit the number of fields showed in different pages such as [masterTable]list.php
(using $this->fieldname->Visible = FALSE in Page_Load) but I cannot do the same
in the [detailTable]list.php page with regard to the fields of the master record.

Basically, you can do the same thing in your detail table page, even you can also manipulate the visibility of your master table field from the detail list page.

Read also this: http://www.hkvforums.com/viewtopic.php? ... 24_GLOBALS[+master+]#p101784


justapeek
User
Posts: 3

Post by justapeek »

I had few time so I've tried just today. But still no success. I can hide fields basically everywhere except the master's fields on the detail page.

I have avoided the problem of waste of space on the page customizing the CSS and alongside the master's fields horizontally. In this way it is compacted in the upper part of the screen, and in the lower part is visible a good portion of the grid of the detail records.


justapeek
User
Posts: 3

Post by justapeek »

Ok I well know, the previous approach was not reusable because I had customized the code after its generation.

Now, with a little more time, I found a better way that is based on the Custom Template for Master Record Page:

<table class="table table-bordered table-striped" style="max-width:700px; table-layout: fixed;">
<tbody>
<tr><td>{{{field#1}}}</td><td>{{{field#2}}}</td><td>{{{field#3}}}</td></tr>
<tr><td>{{{field#4}}}</td><td>{{{field#5}}}</td><td>{{{field#6}}}</td></tr>
</tbody>
</table>

This generates a table with three (or more) fields per row, which has the same style of the PHPMaker tables. Also, to better distinguish the field names from their content, I have highlighted it with bold inserting this style in my custom CSS:

.control-group {font-weight:bold;}

However the approach is not ideal yet, because it forces you to edit the template where a change in the name of the fields, but it is much more acceptable than the previous one.


Post Reply