bootstrap开发中遇到的坑

欢欢欢欢 发表于 2018-10-10 17:21

bootstrap table技术文档:摸这里

坑一:bootstrap 如何默认选中行

解决方案:

1,要有checkbox

2,checkbox要设置formatter

3,formatter返回指定格式的内容

function stateFormatter(value, row, index) {
    if (row.state == true)
        return {
            disabled : true,//设置是否可用
            checked : true//设置选中
        };
    return value;
}
 
坑二:取消或选中某一行
解决方案:
使用方法  check/uncheck,而不是方法 unselectRow;bootstrap貌似没有unselectRow这个方法。