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}}
],
一个jqGrid的现在我想用行动格式的编辑按钮一起添加自定义按钮。
我试过这个,似乎没有工作,任何猜测为什么?
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});
}
},
我认为你应该编写自己的格式化程序,因为你不使用删除操作,并且你想定制编辑按钮。 – jbrtrnd 2012-07-06 12:22:27
不,我想让我的编辑按钮保持原样,再加上我想添加一个按钮以及编辑。那么你能给我一些例子吗? – 2012-07-06 14:40:35