Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Work with 2 popup

Hi

Im working in app with delete button.
First, this button open a new confirmation popup.
If user accept the delete data, this open a new information popup if the delete was correct.
Then, when user Tap the information popup, I need to close all popup and go again to menu.
All this actions with JS.
open popup: $.mobile.changePage($('div[dsid="BorratCorrectament"]'), {transition: "pop"});
close popup: $('div[dsid="ModificarVenda"]').dialog('close');

The problem is:
If I put the code like this: This open information popup , close it automaticaly and return to the confirmation popup.

If I only put open popup: This open the popup. When i Tap the information popup this close it and return to confirmation popup.
If i put in the events of the information to close the information and confirmation, only close information and return to confirmation.

How can I create a sequenceof events to open the information popup and then close all to return to menu?

Thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Work with 2 popup

Hello! This is the way it works, there can be only one popup on page. When you open popup from another popup, first one is deleted from DOM, that's why there is no way to close all at once. You would need to close them one by one manually or programmatically.

Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Work with 2 popup

but if I close the first and then open one new:

The 2 popup open and close fast.
Then the 1 popup come up again.

close popup: $('div[dsid="ModificarVenda"]').dialog('close');
open popup: $.mobile.changePage($('div[dsid="BorratCorrectament"]'), {transition: "pop"});

What it's wrong?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Work with 2 popup

Hi Jordi,

To open popup run:preAppery.navigateTo('ScreenName', {
transition: 'pop'
});/pre
To close:preclosePopup();/preWhere 'ScreenName' is a popup name.

Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Work with 2 popup

ok thanks Katya

I will try this but with the other form work too.

The problem was that when i opened 2 popup.

Now I use one local variable, close the first and if i need to open the 2 I know it with the variable and then open with code.

Thanks for your time :)

Return to “Issues”