Page 1 of 1

How to use popups?

Posted: Thu Jan 02, 2014 7:37 am
by TomMcCann

I've tried building a dialog box with a popup. The popup contains a grid with an input control and a button whose click event closes the popup.

When I call the popup from a button on the main page, the popup is displayed (very badly) but the 'Close' button in the popup has no effect.

Also, the popup just looks and behaves like a page, I was expecting it to 'overlay' the page it is called from.

I have definitely created the popup as a popup rather than a page. I'm using the click events of the buttons to open and close the popup.

I can't find any documentation on how popups should be used in appery. Can you please point me towards some doc or tutorial or example. Thank you.


How to use popups?

Posted: Thu Jan 02, 2014 8:04 am
by Oleg Danchenkov

How to use popups?

Posted: Thu Jan 02, 2014 8:06 am
by Alex GG

hello, I had same problem, and I found solution in another post:
Paste this in Custom JS:

var toast = function(msg){
$(""+msg+"")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
color: "pink",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2})
.appendTo( $.mobile.pageContainer ).delay( 5500 )
.fadeOut( 700, function(){
$(this).remove();
});
}

-then, on button click run this JS:
toast("message");

The message dissapear after 5 seconds, if you want to add a "close button" there are another post similar to this, with the code for an overlaying pop up.
good luck!


How to use popups?

Posted: Thu Jan 02, 2014 9:06 pm
by Kateryna Grynko

Hi Alex,

Thank you for sharing this!