var tempgrid = $("#grid").kendoGrid({ dataSource: { requestStart: function (e) { kendo.ui.progress($("#grid"), true); }, requestEnd: function (e) { kendo.ui.progress($("#grid"), false); }, transport: { read: { url: "/Project/GetAEByProId", dataType: "json" } }, pageSize: 1, serverPaging: true, serverFiltering: true, schema: { type: "json", data: "Data", total: "total", model: { id: "id", fields: { id: "id" } } }, filter: [ { field: "Project_Id", value: @Project_Id } ] }, scrollable: true, sortable: false, filterable: false, attributes: { "class": "grid-algin-center" }, pageable: { refresh: true, pageSizes: true, buttonCount: 5, page: 1, pageSize: 5, pageSizes: [5, 10, 15], messages: { display: "显示 {0}-{1} 共 {2} 项", empty: "没有数据", itemsPerPage: "每面显示数量", first: "第一页", last: "最后一页", next: "下一页", previous: "上一页" } }, columns: [ { field: "CenterName", title: "机构名称", "100px" }, { field: "PatientName", title: "姓名", "8%", template: "<div >#=PatientName.substring(0,1)#**</div >" }, { field: "AETERM", title: "不良事件名称", "100px" }, { field: "AESEVName", title: "严重程度" }, { field: "AESTDAT", title: "开始时间", template: "<div>#=AESTDAT.substring(0,AESTDAT.length-8)#</div >" }, { field: "AEENDAT", title: "结束时间", template: "<div>#=AEENDAT.substring(0,AEENDAT.length-8)#</div >" }, { field: "AEONGODAT", title: "如仍有,目前日期", template: "<div>#=AEONGODAT.substring(0,AEONGODAT.length-8)#</div >" }, { field: "AEACNName", title: "试验药采取措施" }, { field: "AERELName", title: "与研究药物的相关性" }, { field: "AEOUTName", title: "结果" }, { field: "AEDocTitle", title: "AE文档", template:"# if (AEDocTitle != null ) { #'<a class='btn btn-xs green' onclick='downloadFile(#=ID#)'>#=AEDocTitle##=ExtensionName#</a >'# } #" } ] });
以上来源:https://blog.csdn.net/u012571917/article/details/82665518
对于.netcore版本来讲
columns.Bound(o => o.kq).Title("考勤号").Width(124).ClientTemplate("# if (kq != null ) { #<a role='button' class='k-button k-button-icontext k-grid-delete' onclick='downloadFile(#=zgdm#)' href='##'>#=jc##=xm#</a ># } else {# 无考勤#}#");
一定要加 href='##' ,不加的话应用主题时显示的字体颜色是表格的样式,而不是按钮的样式!!!