美文网首页
layuiTable根据返回的JSON内容改变指定行的颜色

layuiTable根据返回的JSON内容改变指定行的颜色

作者: Medicine_8d60 | 来源:发表于2019-07-29 11:53 被阅读0次

    table.render({
    ...
    ...
    ...
    done: function (response) {

       //定位当前table视图
       var tableView = this.elem.next();
    
        //response.data获取后端返回的JSON格式数据
       $.each(response.data,function (index,item) {
    
            //逻辑判断
           if(item.status == "1"){
                //改变TR标签内字体颜色
               tableView.find('tbody tr[data-index="'+ index +'"]').css('color','#01AAED');
           }
       })
    
    }
    

    })

    相关文章

      网友评论

          本文标题:layuiTable根据返回的JSON内容改变指定行的颜色

          本文链接:https://www.haomeiwen.com/subject/razvrctx.html