Hi AppGini’rs.
Is there a way to open a form, in a modal, from a link in a custom Page?
For new record and/or existing record?
TIA
Link to open form in modal on custom page
Link to open form in modal on custom page
Last edited by jmcgov on 2022-11-02 22:48, edited 1 time in total.
Re: Link to open form in modal on custom page
Check AppGini's modal_window function in javascript. Use options.url.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Link to open form in modal on custom page
Thank you jsetzer, I’ll search for that function.
Re: Link to open form in modal on custom page
I've made progress on this, thanks, but there seems to be something tricky...
In a nutshell
- I have a custom page that displays data and contains a link to open the data record for edit, in a modal (works OK)
- I update the record, click save button (to update the record and close the modal) (works OK)
- I'm trying to use the "close" attribute of modal to do an AJAX refresh (refreshContact) of the data on custom page (not OK, see below)
It seems that the AJAX function is being called before the record is updated (probably on initial page load) - Modal options settings below
let options = {
url: table_name + "?SelectedID=" + SelectedID + "&Embedded=1",
id: "modal" + button_id,
size: 'full',
close: refreshContact(SelectedID),
title: heading
};
modal_window(options);
Am I misunderstanding the purpose of the "close" option?? I.E. to trigger the named function when the modal is closed
PS - I figured out this function by finding the actual function (in common.js), but is there documantation for it?
In a nutshell
- I have a custom page that displays data and contains a link to open the data record for edit, in a modal (works OK)
- I update the record, click save button (to update the record and close the modal) (works OK)
- I'm trying to use the "close" attribute of modal to do an AJAX refresh (refreshContact) of the data on custom page (not OK, see below)
It seems that the AJAX function is being called before the record is updated (probably on initial page load) - Modal options settings below
let options = {
url: table_name + "?SelectedID=" + SelectedID + "&Embedded=1",
id: "modal" + button_id,
size: 'full',
close: refreshContact(SelectedID),
title: heading
};
modal_window(options);
Am I misunderstanding the purpose of the "close" option?? I.E. to trigger the named function when the modal is closed
PS - I figured out this function by finding the actual function (in common.js), but is there documantation for it?
Re: Link to open form in modal on custom page
Hi
I have figured this out, thanks to another poster (Ahmed, no less), TY
viewtopic.php?f=8&t=2501&p=16397&hilit= ... b24#p16397
I was loading the close function incorrectly. Code as below,
let options = {
url: table_name + "?SelectedID=" + SelectedID + "&Embedded=1",
id: "modal" + button_id,
size: 'full',
close: function() {
location.reload();
},
title: heading
};
I have figured this out, thanks to another poster (Ahmed, no less), TY
viewtopic.php?f=8&t=2501&p=16397&hilit= ... b24#p16397
I was loading the close function incorrectly. Code as below,
let options = {
url: table_name + "?SelectedID=" + SelectedID + "&Embedded=1",
id: "modal" + button_id,
size: 'full',
close: function() {
location.reload();
},
title: heading
};