<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");
答案 0 :(得分:3)
如果其他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());