1、当我点击表格中的选择框时,操作按钮变成提交
隐藏列属性
hide : true,
部分代码如下
}, {
display: '是否启用',
name : 'enable_a',
width : '80',
render: function (rowdata, rowindex, value){
var e = "";
if (!rowdata._editing){
if(rowdata.enable_a == "1"){
e += "<input name = 'enable_a' type='checkbox' checked = 'checked' style = 'margin: 6px 0px 0px 0px;width: 18px;height: 18px;' onclick=\"checkboxOnclick(this,"+rowindex+")\" >";
}else{
e += "<input type='checkbox' name = 'enable_a' style = 'margin: 6px 0px 0px 0px;width: 18px;height: 18px;' onclick=\"checkboxOnclick(this,"+rowindex+")\" >";
}
}
return e;
}
}, {
部分代码如下:
display: '操作',
name : 'flag_bz',
isSort: false,
width: 100,
render: function (rowdata, rowindex, value){
var h = "";
if ("0" == rowdata.flag_bz)
{
h += "<a href='javascript:beginEdit(" + rowindex + ")'>修改</a> ";
// h += "<a href='javascript:deleteRow(" + rowindex + ")'>删除</a> ";
}
else
{
h += "<a href='javascript:endEdit(" + rowindex + ")'>提交</a> ";
// h += "<a href='javascript:cancelEdit(" + rowindex + ")'>取消</a> ";
}
return h;
}
js代码
function checkboxOnclick(checkbox,rowindex){
if (checkbox.checked == true){
//alert(12);
//Action for checked
}else{
//Action for not checked
//alert(13);
}
var ssd = manager2.getRow(rowindex);
manager2.updateCell('flag_bz', "1", ssd);
}
后续的话:
flag_bz字段和enable_a一样是后台实体类的一个字段,
另如果更改明细表格的情况[例如官网的示例:明细–设置高度]下,如果同时打开多个明细表格,更改单元格就会出现问题