0

我想每次OpenDialog()调用方法时都打开对话框及其内容。

功能:

function OpenDialog(){
    $("#seeContent").dialog({
                autoOpen: "false",
                stack: "true",
                height: "600",
                width: "700",
                resizable: "false"
            });
}

函数调用:

<input type="button" onclick="OpenDialog()">

Note:第一次调用时它工作正常,第二次调用时它会覆盖第一次调用。

4

2 回答 2

1

HTML:

<input type="button" id="open_dialog">
<div id="content"></div>

JS:

$('#open_dialog').click(function(){
var data = getData();     //Get new data
$('#content').html(data); //Replace old data
$('#content').dialog({    //Open dialog
     autoOpen: "false",
     stack: "true",
     height: "600",
     width: "700",
     resizable: "false"
    });
});

本质上,每次单击打开对话框时,都应先加载新数据,然后再打开对话框。

于 2012-12-15T06:58:36.983 回答
0

帮助我创建对话框的clone()副本。以下是我的工作代码。

jQuery("#seeContent").clone().dialog(
            { autoOpen: "false",
              stack: "true",
              height: "600",
              width: "700",
              resizable: "false" }
  });

我发布了这个答案,因为我可以帮助别人。

希望,它会帮助你。谢谢。!!

于 2012-12-15T10:18:47.610 回答