У меня есть приложение, в котором одновременно могут быть открыты несколько диалогов 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; }
}
});