J Harley
J Harley

Reputation: 285

jQuery UI Multiple Dialogue's

I have a table and for every row I would like to create a dialogue box and a link that can be clicked to launch that dialogue box.

E.g. Name 1 (click to get more details). { these are the details for name 1} Name 2 (click to get more details). { these are the details for name 2}

So I would need a dialogue function that I can pass a custom title and body to... And then call that on the click of a link Click here to launch dialogue

I hope I have made myself clear.

Many Thanks, JPH

Upvotes: 0

Views: 225

Answers (1)

Jochem
Jochem

Reputation: 2994

I think this will do what you asked for:

<DIV id="MyDialog">

</DIV>

<SCRIPT>
    $(function() {
        $("#MyDialog").dialog({autoOpen: false});
    });

    function showdialog (title, body) {
        $("#MyDialog").html(body);
        $("#MyDialog").dialog("option", "title", title);
        $("#MyDialog").dialog('open');
    }

</SCRIPT>

Upvotes: 1

Related Questions