John Kornick
John Kornick

Reputation: 295

two popups in a listview with jquery-mobile?

I want to be able to navigate from the purchase popup to the edit popup, but when I click on "Edit", it doesn't bring out the edit popup, it just closes the purchase popup.

    <div data-role="popup" id="purchase" data-theme="a" data-overlay-theme="c">
    <div data-role="popup" id="edit" data-theme="a" data-overlay-theme="c">

http://jsfiddle.net/3vkg7hfb/

How can I do this?

Upvotes: 1

Views: 43

Answers (1)

John Kornick
John Kornick

Reputation: 295

Omar (https://stackoverflow.com/users/1771795/omar) came up with this, which works well.

$(document).on("pagecreate", function (e) {
  $(".edit", e.target).on("click", function () {
    $("#purchase", e.target)
        .one("popupafterclose", function () {
        $("#edit", e.target)
            .popup({
            transition: "pop"
        })
            .popup("open");
    })
        .popup("close");
 });
});

http://jsfiddle.net/psgu4y9j/

Upvotes: 1

Related Questions