Javascript jQGrid-排序行上的重新排序操作按钮
如何根据关注行的排序重新排列jQGrid中操作按钮(编辑和删除)的排序顺序 HTML:Javascript jQGrid-排序行上的重新排序操作按钮,javascript,jquery,sorting,jqgrid,Javascript,Jquery,Sorting,Jqgrid,如何根据关注行的排序重新排列jQGrid中操作按钮(编辑和删除)的排序顺序 HTML: <table id="grid"></table> 这是我的 我在网格中编码了不同的编辑按钮和保存按钮 如果有人觉得很难理解我的疑问,我会更新这篇文章 谢谢我建议使用自定义格式功能(格式化程序),它可以呈现按钮。在每个按钮上,可以使用行参数设置单击处理程序 colModel:[ {name:'act',index:'act', width:120, sortable:f
<table id="grid"></table>
这是我的
我在网格中编码了不同的编辑按钮和保存按钮
如果有人觉得很难理解我的疑问,我会更新这篇文章
谢谢我建议使用自定义格式功能(格式化程序),它可以呈现按钮。在每个按钮上,可以使用行参数设置单击处理程序
colModel:[
{name:'act',index:'act', width:120, sortable:false, formatter: customFormat},
{name:'emp_name', index:'emp_name', key: true, width:100, editable:true},
{name:'emp_id', index:'emp_id', width:80, editable:true},
{name:'addr', index:'addr', width:100, editable:true}
],
function customFormat (cellvalue, options, rowObject) {
console.log(rowObject);
return '<input type="button" class="editbtn" value="edit" onclick="console.log('+rowObject.emp_id+')"/><input type="button" class="delbtn" value="del" onclick="console.log('+rowObject.emp_id+')"/>';
}
colModel:[
{name:'act',index:'act',width:120,sortable:false,formatter:customFormat},
{name:'emp_name',index:'emp_name',key:true,width:100,editable:true},
{名称:'emp_id',索引:'emp_id',宽度:80,可编辑:true},
{名称:'addr',索引:'addr',宽度:100,可编辑:true}
],
函数customFormat(cellvalue、options、rowObject){
console.log(rowObject);
返回“”;
}
知道单击了哪个emp_id,您可以调用自己的自定义函数,该函数将对该emp_id执行某些操作