【发布时间】:2019-01-19 11:39:36
【问题描述】:
我有一个可以同时打开多个 jQueryUI 对话框的应用程序。
我的问题是我无法弄清楚如何在对话框的打开处理程序中仅找到当前对话框元素。
我尝试了 $(this)、ui、ui.dialog 和其他一些东西,但没有结果。
$("<div class='dialog' title='" + title + "'><p>" + text + "</p></div>")
.dialog({
closeOnEscape: false,
open: function (event, ui) {
/*
What can I use to filter the two selectors below
so that they only affect the current dialogs contents?
*/
$(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
$('.ui-dialog-buttonpane', ui.dialog | ui).find('button').each(function (id, el) {
/* This cycles through all buttons on all dialogs */
debugger;
});
},
buttons: {
"Button 1": function () { doStuff; },
"Button 2": function () { doStuff; },
"Button 3": function () { doStuff; }
}
});
【问题讨论】:
标签: jquery-ui-dialog