【发布时间】:2014-02-24 07:45:02
【问题描述】:
我在使用剑道 ui 对话窗口时遇到问题。当我第二次打开剑道对话框窗口并单击接受按钮时,事件会触发两次,下一次触发三次,依此类推。 有工作示例http://jsfiddle.net/T89mG/74/。 我哪里做错了?
addToQueueWindow = $("#AddToQueueWindow").kendoWindow({
modal: true,
visible: false
}).data("kendoWindow");
$(document).ready(
$("#showAddMessageDialog")
.button()
.click(function (e) {
addToQueueWindow.center().open();
addToQueueWindow.wrapper
.find(".add-confirm,.add-cancel")
.click(function (e) {
if ($(this).hasClass("add-confirm")) {
$.ajax({
url: '@Url.Action("AddToQueueHandler", "ManageMessageState")',
type: 'POST',
data: { Id: $("#MessageidInput").val() },
complete: function (event, ui) {
$("#QueueContentGrid").data("kendoGrid").dataSource.read();
}
});
}
addToQueueWindow.close();
});
})
);
【问题讨论】: