Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Return to the browse after saving in a popup

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
nathan
Posts: 40
Joined: Tue Apr 19, 2022 9:18 pm
Been thanked: 3 times

Return to the browse after saving in a popup

Unread post by nathan »

Hi it’s me again,
I would like to return to the browse after saving in a popup…
Form A: browse/edit
Form B: Edit only
Here is the sequence I would like,
Open form A in “Browse”
Choose a row, open form A in “Edit”
On form A click a button that opens Form B in POPUP “Edit”
On save Form B, Close POPUP (Form B) return to Form A in “Browse”

Thank you in advance for your help !!!
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Return to the browse after saving in a popup

Unread post by kev1n »

Hi,

Code in the popup / form B (untested):

Code: Select all

function nuAfterSave() {
	
	if (parent.$('#nuModal').length > 0) {
		let l = parent.window.nuFORM.breadcrumbs.length;
		if (l > 1) {
			parent.nuGetBreadcrumb(l - 2);
		}
	}
}
warfreak05
Posts: 5
Joined: Mon Jul 05, 2021 8:38 am

Re: Return to the browse after saving in a popup

Unread post by warfreak05 »

hi any suggestion how to close pop-up B after saving?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Return to the browse after saving in a popup

Unread post by kev1n »

Try it like this:

Code: Select all

function nuAfterSave() {
	
	if (parent.$('#nuModal').length > 0) {
             nuClosePopup();
	}
}
warfreak05
Posts: 5
Joined: Mon Jul 05, 2021 8:38 am

Re: Return to the browse after saving in a popup

Unread post by warfreak05 »

kev1n wrote: Wed Jul 13, 2022 1:09 pm Try it like this:

Code: Select all

function nuAfterSave() {
	
	if (parent.$('#nuModal').length > 0) {
             nuClosePopup();
	}
}

hi, who try this code? is it working?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Return to the browse after saving in a popup

Unread post by kev1n »

Can you describe your use case in more detail? How do you open the popup, where did you add the code, what do you expect to happen when the form closes?
Post Reply