Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Leaving an iFrame

Questions related to using nuBuilder Forte.
Post Reply
marcus
Posts: 20
Joined: Mon Nov 29, 2021 10:16 am

Leaving an iFrame

Unread post by marcus »

Hi, i have an iFrame with a browse Window in it. When clicking an entry id like the Edit Window to be opened in the main screen instead the iFrame, is there a possibilty to achieve this?

Best regards!
marcus
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Leaving an iFrame

Unread post by kev1n »

If you add this JS function to the iframe's Custom Code, the record should be opened in the main form .

Code: Select all

function nuSelectBrowse(e){
    
    var r   = $('#' + e.target.id).attr('data-nu-primary-key');
    parent.nuForm(nuGetProperty('form_id'), r, '', '', '1');

}
marcus
Posts: 20
Joined: Mon Nov 29, 2021 10:16 am

Re: Leaving an iFrame

Unread post by marcus »

Thanks a lot! It works very well.
saultpastor
Posts: 42
Joined: Sat Jul 18, 2015 8:04 pm
Has thanked: 3 times

Re: Leaving an iFrame

Unread post by saultpastor »

I am using this code with a browse (only) form in an iframe, but it redirects to a different edit form. The code opens an edit form (with no objects) in the main form, not the redirected edit form. If I remove the code it opens the redirected edit form but in the iframe (of course).

Thanks
Craig
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Leaving an iFrame

Unread post by kev1n »

Open the "Redirect To" form instead

Code: Select all

function nuSelectBrowse(e){
    
    var r   = $('#' + e.target.id).attr('data-nu-primary-key');
    parent.nuForm(nuGetProperty('redirect_form_id'), r, '', '', '1');

}
Post Reply