在jqGrid中新增、删除、编辑等操作按钮

来源:互联网 发布:mac需要清理软件 编辑:程序博客网 时间:2024/05/30 23:02

在jqGrid中新增、删除、编辑等操作按钮,使用formatter方法!

CSS代码

colNames : [ '主键',  '客户姓名', '申请开卡'],colModel : [             {name: 'id', index: 'id', hidden:true},            {name: 'customerName',index: 'customerName',width: win,align: "left"},            {name: 'operate', index: 'operate',                formatter: function (value, grid, rows, state) {                     return '<a href="javascript:void(0);" style="color:#f60" onclick="modify(\''+ rows.id+ '\');">申请开卡</a>';                }              }],

JS代码

function modify(obj){    //obj带的是参数rows.id    alert(obj);}
阅读全文
0 0