bootstrap-table 回显选中行,行样式


{
    filed:'status',
    checkbox:true,
    formatter:function(value,row,index){
        if (row.status == 1)  //根据行里字段判断是否选中
            return {
                checked : true//设置选中
            };
        return value;
    }

}

 

行样式:

  rowStyle: function (row, index) {
                //这里有5个取值代表5中颜色['active', 'success', 'info', 'warning', 'danger'];
                var strclass = "";
                if (row.name == "删除环境") {
                    strclass = 'danger';//还有一个active
                }
                else if (row.name == "新增环境") {
                    strclass = 'success';
                }
                else {
                    return {};
                }
                return { classes: strclass }
            },

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM