Page 1 of 1

Work with 2 popup

Posted: Tue Feb 04, 2014 10:39 am
by Jordi Niubo

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


Work with 2 popup

Posted: Tue Feb 04, 2014 12:27 pm
by Maryna Brodina

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.


Work with 2 popup

Posted: Tue Feb 04, 2014 12:47 pm
by Jordi Niubo

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?


Work with 2 popup

Posted: Wed Feb 05, 2014 2:41 pm
by Kateryna Grynko

Hi Jordi,

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


Work with 2 popup

Posted: Wed Feb 05, 2014 4:45 pm
by Jordi Niubo

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 :)