当我在初始化后检查kendoNotification时,它出现未定义。因此,show()方法未运行且未显示通知。如何解决这个问题?
<div id="appendto" class="demo-section k-content"></div>
<% Html.Kendo().Notification()
.Name("staticNotification")
.AppendTo("#appendto");
%>
我在按钮点击事件上调用此函数。
function showNotification(text) {
var staticNotification = $("#staticNotification").data("kendoNotification");
////// in here when you check the staticNotification, it is appearing as undefined
staticNotification.show(kendo.toString(d, 'HH:MM:ss.') + text, "info");
var container = $(staticNotification.options.appendTo);
container.scrollTop(container[0].scrollHeight);
}