【发布时间】:2014-04-23 12:06:33
【问题描述】:
我正在使用 MVC 构建一个应用程序,使用 Jquery(KendoGrid) 来显示数据,一切都按要求正常工作,后来我们计划在网格的每一行上添加带有按钮的额外列,听起来很简单,但尝试了数字添加到应用程序中的方法,收到错误消息“未定义的'节点'.....”,所以我没有其他选择,只能在这里发布,如果有人能帮助我,我将不胜感激,我在 jquery kendo 网格上使用了列模板谢谢
场景
onclick 指定行中的该按钮应带有“ID(如下所示)”并重定向到“ActionResult”控制器,我可以在其中进一步编码我的要求
代码(部分代码)
columns: [
{ field: "ID", Title: "ID", filterable: false, sortable: false, hidden: true },
{ field: "RowID", Title: "RowID", filterable: false, sortable: false, hidden: true },
{ field: "BillNumber", Title: "BillNumber", filterable: false, sortable: false,hidden:true },
{ field: "ServiceName", Title: "ServiceName",width:600 },
{ field: "ServiceStatus", Title: "ServiceStatus", width: 150 }
// Creating template column
, {
field: "Action", title: "Is Action", template: "<input type=\"checkbox\" #= Action ? checked='checked' : '' # class=\"check_row\"/> ", editable: false,
// field: "Action",title: "Preview ", template: '<input type="button" class="info" name="info" value="Info" style="height: 26px; margin: 0px 2px; min-width: 64px;" />',
headerTemplate: '<label> <input type="checkbox" id="checkAll"/>Print All</label>', filterable: false, sortable: false, width: 100,
}
目前我能够在列中生成复选框,我需要的是多一列带有按钮(与每一行中的复选框相同)
Manjuboyz
【问题讨论】:
-
查看我对以下帖子的回答,我在每一列中都显示了一个下拉列表,您应该能够操作代码来添加一个按钮。 stackoverflow.com/questions/23217890/…
-
嗨 C Sharper 感谢您的回复,但我没有使用“columns.bound”或“客户端模板”,我不想编辑我的任何代码(因为它按照我的要求),请建议我可以编辑的代码