
toolbar: ["-", {
id: '',
text: '',
iconCls: '',
handler: function () {}
}, "-", {
id: '',
text: '',
iconCls: '',
handler: function () { }
}, "-", {
id: '',
text: '',
iconCls: '',
handler: function () { }
}, "-"]
第二种方法是在页面些个div 在里面可以放入 按钮 输入框 搜索框 之类的 并且给这个div 设置一个 id 然后再定义 datagrid 的地方写 toolbar:"#div的id"
首先,为需要编辑的列设置编辑器 例如: {field:'F1',title:'编辑咧列',width:100,align:'center', editor: { type: 'numberbox', options: { min:1 } } } 第二步,按钮点击事件中添加代码 $('#dg').datagrid('appendRow',{ F1: '新名称' })用formatter 举个例子
{ field: 'ed', title: ' *** 作', width: 80, align: 'center',formatter: function (value, rowData, rowIndex) {
return "<input type='button' value='click'>"
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)