bootstrap table插件可能会遇到的问题

本人小白一名,若有不对的地方请指正,不喜勿喷!!工具

  1. 带复选框的表格设值spa

    不建议直接使用<th data-checkbox=”true”></th>,它没法为复选框赋值。orm

    解决方法:input

    使用列的data-formatter属性来处理。it

    列的格式化方法,包含3个参数:io

value: 该单元格的数据。
row:
该行的数据。
index:
该行的indexfunction

eg:form

<th data-field="id" data-formatter="checkBox" data-align="center" data-switchable="false"><input type="checkbox" name="chbAll" id="chbAll"></th>方法

function checkBox(value,row,index){
          
return '<input type="checkbox" name="chb" value="'+value+'">';
}
checkbox

便可实现复选框中包含一个你想要的值

2.自定义表格工具条

使用data-toolbar="#custom-toolbar" 便可,custom-toolbar是自定义工具条的id

后续会添加上其余的问题!