剑道通知未初始化

时间:2017-03-30 07:14:18

标签: asp.net-mvc kendo-ui notifications kendo-asp.net-mvc

当我在初始化后检查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);
 }

0 个答案:

没有答案