layui根据条件修改表格固定行的颜色

当按钮样式存在 “noedit”时,该行变灰色

 var data={
       table :{
            id:'userlist-table',
            options:{  
                done:function(res,curr,count){
                    res.data.forEach(function (item, index) {
                        if((item.l).indexOf("noedit")>0){
                            $(".layui-table-box tbody tr[data-index='" + index + "']").css("background-color", "#ececec52");
                        }
                        
                    }) 
                },

            }
        },
        page :{ 
            id:"page",
            fromId:"searchFrom",
            options:{ 
                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                first: '首页',
                last: '尾页'
            }
         }
   };

猜你喜欢

转载自blog.csdn.net/u012011360/article/details/100665306
今日推荐