This topic is locked
[SOLVED]

 Master add page + add detail record in popup not iniline

7/5/2019 10:24:33 PM
PHPRunner General questions
woodey2002 author

Hi Guys
A quick question if I may.
In my project I have a master-detail relationship setup between two, tables patient (master) and checkup (detail)
Everything is working as expected however when I add a NEW MASTER record, I would very much like to have on the master add page, an add new button which opens in a popup for the detail rather the only option I can see of add inline for the detail record.
If I choose to edit a master record I can see the behaviour I want for the detail record i.e. an add new button which opens a popup and no inline add.
I have been trying this for ages with no luck.
On the master add page, I can't seem to be able to find an option use the add new button which opens the details table add page in a popup.
Is possible to have that?
If not do you know any workarounds? As I would love to keep all fields in a single master add/edit record showing details in tabs rather having to use the standard master list page and detail table link tabs.
Is it worth my while at maybe deleting the inline add button for the detail table and adding a custom button for detail add new which opens a popup
Many thanks,

J

lefty 7/6/2019



Hi Guys
A quick question if I may.
In my project I have a master-detail relationship setup between two, tables patient (master) and checkup (detail)
Everything is working as expected however when I add a NEW MASTER record, I would very much like to have on the master add page, an add new button which opens in a popup for the detail rather the only option I can see of add inline for the detail record.
If I choose to edit a master record I can see the behaviour I want for the detail record i.e. an add new button which opens a popup and no inline add.
I have been trying this for ages with no luck.
On the master add page, I can't seem to be able to find an option use the add new button which opens the details table add page in a popup.
Is possible to have that?
If not do you know any workarounds? As I would love to keep all fields in a single master add/edit record showing details in tabs rather having to use the standard master list page and detail table link tabs.
Is it worth my while at maybe deleting the inline add button for the detail table and adding a custom button for detail add new which opens a popup
Many thanks,

J



For Add Page : ( Bootstrap Only)
Unfortunately, This is by design. I have been trying to get around this also . I even added an extra button "ADD NEW" with from manual
var win = Runner.displayPopup( {
url:"yourtable_add.php",
width: 700,
height: 500,
header: 'Add new'
});
in the client before and client after window.parent.location.reload(); and window.parent.popup.close(); or win.close () . but not working as expected.
See this link for more info
The problem with this code it also lists the details again in the popup along with another extra add record, instead of just a new record and you have to code it to close the popup after save and refresh original page. Also how to delete the inline add button without playing with the HTML?





I guess it was designed this way because the master record has no data yet so there is no data for the related details. Where as inline after record is saved on same page the details are updated on same page. I would think you should still have that option but will this will require a lot of custom coding hopefully this will be changed in the future, although I believe all versions had it this way.
If it had worked just like the edit page , it would be great no need to do any custom coding , although you would have to refresh to see details I believe , that would be the only difference.
Reason it is needed if you use inline and have a large number of fields you have to scroll all across the screen , not very appealing to the users.
if you get this working please post

woodey2002 author 7/7/2019

Thanks John for your most detailed explanation, I understand the process now.
A slight workaround I'm looking into at the minute is to an the add page not include any of the detail tables, force the user to save the master, then after save redirect to that records edit page where popup viewable detail table can be found.
Many thanks again.
James