获取错误kendo未定义

时间:2014-01-31 07:14:52

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

<script type="text/javascript">
var attachmentTemplate = kendo.template($("#attachment").html());

function showAttachments(e) {
    e.preventDefault();

    var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
    var wnd = $("#Attachments").data("kendoWindow");

    wnd.content(attachmentTemplate(dataItem));
    wnd.center().open();
}

这里肯定在kendo.template行中修改了kendo,即使我有@ kendo.mvc.ui

  columns.Command(command => command.Custom("Attachments").Click("showAttachments")).Title("Attachments");

1 个答案:

答案 0 :(得分:3)

  • 右键单击所有剑道参考
  • 将true设置为LocalCopy字段
  • 然后清理项目并构建项目

如果其他kendo元素有效,这不起作用:)

<script type="text/javascript">

function showAttachments(e) {
    e.preventDefault();

    var attachmentTemplate = kendo.template($("#attachment").html());

    var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
    var wnd = $("#Attachments").data("kendoWindow");

    wnd.content(attachmentTemplate(dataItem));
    wnd.center().open();
}

尝试在函数

中使用var attachmentTemplate = kendo.template($("#attachment").html());