Siddharth Trikha
Siddharth Trikha

Reputation: 2506

Multiple Jquery-ui dilaog box with one button

I am using jquery ui Dialog box. It works fine but I have a requirement that with one button I should be able to create a dialog box with each click.

So Eg: On first click a dialog box is opened. On second click, a new dialog must be created with the first one intact at it's place. I am implementing sticky notes using this.

How can this be achieved??

Upvotes: 0

Views: 48

Answers (1)

Chamika Sandamal
Chamika Sandamal

Reputation: 24332

You can create Modal Dialog Dynamically

$("button").click(function () {
    var dynamicDialog = $('<div id="MyDialog">cotent            </div>');
    dynamicDialog.dialog({
        title: "Success Message",
        modal: false,
        buttons: [{
            text: "Yes",
            click: function () {}
        }]
    });
});

Demo

Note: since all come on same location just move and see the new dialog in the demo

Upvotes: 1

Related Questions