开发者

JQuery UI Dialog buttonpane div appendTo form

I want to append the panel that is created for the buttons in the dialog. So i can access controls in the form with the Print button.

$(document).ready(function() {
    $(".dialogDiv").dialog({
        autoOpen: false,
        modal: true,
        position: [50, 50],
        buttons: {
            "Print": function() {
                //Do stuff
            },
            Cancel: function() {
                $(this).dialog("close");
            }
        }
    });
    $(".dialogDiv").parent().appendTo($('form'));
});

<div class="dialogDiv" title="Printwindow"> ... Controls n stuff</div>

There is a auto-generated div for the buttons and in firebug there is a div that looks like this:

<div class="ui-dialog-buttonpane ui-开发者_如何学运维widget-content ui-helper-clearfix">

The question is then how do i append that to the form also?


Unfortunately @TommyB's solution (in the question's comment) won't work if there are multiple dialogs on a page.

Instead, do this:

$("#mydialog").siblings(".ui-dialog-buttonpane")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜