layui的table表格根据条件设置为不能选择

function fixedCellResize(res) {
     var state = "";
     for (var i in res.data) {
         var item = res.data[i];
         if(item.state == "市级审核中" || item.state == "省级审核通过") {// 这里是判断需要禁用的条件(如:状态为0的)
             // checkbox 根据条件设置不可选中
             $('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true);
             state = "1";// 隐藏表头全选判断状态
         }
         if(state=='1'){
             $('th[data-field="1"] input[type="checkbox"]').prop('disabled', true); // 禁止全选
}
     }
 }

  

posted on 2022-08-23 10:09  IT-QI  阅读(962)  评论(0编辑  收藏  举报