Я видел несколько сообщений об этой проблеме, но я получаю фактическую ошибку, а не просто не открываю. окно успешно открывается успешно. однако я получаю сообщение об ошибке после того, как я закрою его, а затем попытаюсь его снова открыть.как повторно использовать kendo-ui window jquery
Сообщение об ошибке
Uncaught TypeError: Cannot read property 'open' of undefined
$(document).ready(function() {
$(".export-pdf").click(function() {
$.ajax({
url: "/Home/Save",
type: "POST",
data: { source: data },
success: function (data, textStatus, jqXHR) {
openEmailWindow();
}
});
});
});
function openEmailWindow() {
var window = $("#email");
$("#undo1")
.bind("click", function() {
window.data("kendoWindow").open();
});
if (!window.data("kendoWindow")) {
window.kendoWindow({
width: "600px",
title: "Subject Property",
actions: ["Close"],
deactivate: onDeactivate
});
}
function onDeactivate(e) {
this.destroy();
console.log("event :: deactivate");
}
}
});
вид
<span id="undo1" style="margin-left: 865px" class="export-pdf k-button">Print Pdf</span>
<div id="email"></div>