功能需求:判断若审核为“已审核”,则该行数据不可更改,即当前行的按钮可不点击,input不可编辑。反之“未审核”数据可更改。
实现:
function auditRule() {
//size为表格总的数据行数,不包括列名行
var size = $("#size").val();
//循环每一行,i表示当前行数,0起数
for (var i=0;i<size;i++){
//sh为当前行审核列名
var sh = $("#"+i).parent().children("td").eq(10).find("span").text();
if (sh == '已审核'){
//设置当前行的控件不可编辑
$('.btn-default').attr('disabled',true);
$('#gxbhbtn'+i).attr('disabled',true);
$('#gxmcbtn'+i).attr('disabled',true);
$('#listZpgx'+i+'\\.syqty').attr("readOnly",true);
$('#listZpgx'+i+'\\.jgqty').attr("readOnly",true);
$('#listZpgx'+i+'\\.wcqty').attr("readOnly",true);
}
}
}