Skip to main content
Topic: Master/detail list: how to do it in phprad? (Read 1612 times) previous topic - next topic

Master/detail list: how to do it in phprad?

Hello,
I'm new to phprad and I can see a great potential.
I'm trying to create a simple scenario: wine categories > bottles.
I'm near to the solution but I can't get it.

Here is what I would like to obtain:
I have a main Category containing ...well... wine categories ;)
Every record in this table has a link to a detail list table (bottles) (BTW, trying to uploading the image files I receive a message: uploading directory full...).


This is the details list:


In my scenario when I add a new bottle, it should get the same category as the other bottles from the page I'm coming from. Since I'm coming from category 2, the category of the new bottle shuld be Categoery 2. it's easy to do it in simple php, but how can I do this in phprad?
Here is the add bottle page:


I hope this is clear enough.
Thanks in advance for any suggestion.
Tony


Re: Master/detail list: how to do it in phprad?

Reply #2
@sweetman‍ this is how to configure Master Details Relationship PHPRAD | View and List Page Master-Details Relation. And you cannot hide the field, because the record might not be inserted if you do.
I've already set the relation the same way as stated in the video.
But once done this, how can I add a bottle to the same detail list? The form will ask me to select a category manually.
Usually the category comes from an URL parameter or session variable and it's an hidden field.
Is there a way to set the category automatically, with the above principle?
TIA
tony

Re: Master/detail list: how to do it in phprad?

Reply #3
@sweetman‍ it gives you the option to select but the default value is selected. You add the bottle by clicking the master details button and clicking on the add tab when the modal comes up, the master record id should be populated in the select field, thanks. This is the timestamp of the configuration https://youtu.be/1ZZZY5XSWDo?t=169