【发布时间】:2012-07-06 12:15:31
【问题描述】:
我有一个这样的 jqgrid
colNames: ['Name','Actions'],
colModel: [
{ name: 'name', index: 'name', align: 'right', editable: true},
{ name: 'act', index: 'act', width: 75, align: 'center', sortable: false, formatter: 'actions',formatoptions: {keys: true,delbutton:false}}
],
现在我想添加一个自定义按钮以及动作格式化程序的编辑按钮。
我试过了,好像没有用,有什么原因吗?
gridComplete: function(){
var ids = $("#grid").jqGrid('getDataIDs');
for(var i=0;i < ids.length;i++){
var cl = ids[i];
alert(cl);
be = "<input style='height:22px;' type='button' value='Edit' onclick=\"window.location.href='editItem.asp?ID="+cl+"'\" />";
$("#grid").jqGrid('setRowData',ids[i],{act:be});
}
},
【问题讨论】:
-
我认为您应该编写自己的格式化程序,因为您不使用删除操作,并且您想自定义编辑按钮。
-
不,我想保持我的编辑按钮不变,而且我想在编辑的同时再添加一个按钮。那你能给我举个例子吗?
标签: jquery asp.net-mvc jqgrid