Reputation: 3441
I'm looking to include a dialog
on my page which is accessed through a popup
via jQuery Mobile
. The issue I'm having is when I press the button for the dialog, it doesn't show, it seems like the page becomes unresponsive so I don't know if the dialog is just hidden or not. I looked through the jQuery
api to see if there was an option I'm missing but I couldn't find anything.
for reference this is my code:
<a href="#my-popup" role="button" data-rel="popup" class="ui-page-theme-a ui-btn ui-corner-all ui-shadow" data-transition="pop" id="mypop">Title</a>
<div data-role="popup" id="my-popup" data-theme="a" class="ui-corner-all dialog">
<div>
<h3 class="hy-header">Header</h3>
</div>
<a href="#save-button" data-rel="popup" data-position-to="window" data-transition="pop" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b">Save</a>
<div data-role="popup" id="save-button" data-overlay-theme="a" data-theme="a" data-dismissible="false" style="max-width:400px;">
<div data-role="header" data-theme="a">
<h1>Button</h1>
</div>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Save</a>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back" data-transition="flow">Cancel</a>
</div>
jsfiddle: http://jsfiddle.net/tno49rLq/
Upvotes: 0
Views: 341
Reputation: 24738
If you look at the popup documentation (http://api.jquerymobile.com/popup/), you will see that as of version 1.4.x of jQM it does not support chained popups:
The framework does not currently support chaining of popups so it's not possible to embed a link from one popup to another popup. All links with a data-rel="popup" inside a popup will not do anything at all.
There is a workaround in the DOCs that opens the second popup after closing the first one.
In order to have one popup above another, you will need to use a different popup plugin. Fortunately the SimpleDialog2 plugin for jQM does support chained popups. Here is an article describing how to achieve chained popups with SimpleDialog2:
http://jqmtricks.wordpress.com/2014/05/16/chained-popups-with-simpledialog2/
Upvotes: 1