bootstrap表格数据加载完成是触发mergeCells()方法
onLoadSuccess: function (data) {
mergeCells();
}
function mergeCells() {
// 初始化合并索引
var num = 0;
// 获取bootstrap的加载完毕的数据,dataList为表格id,mergeCells为boostrap自带的方法
var row = $("#dataList").bootstrapTable('getData');
for (var i = 0; i < row.length; i++) {
//这其实就是bootstrap的mergeCells属性 自带的合并单元格
$('#dataList').bootstrapTable('mergeCells', {index: num, field: 'indexNum', colspan: 1, rowspan: 3});
$('#dataList').bootstrapTable('mergeCells', {index: num, field: 'useunitName', colspan: 1, rowspan: 3});
$('#dataList').bootstrapTable('mergeCells', {index: num, field: 'gantryNumber', colspan: 1, rowspan: 3});
//每三行合并
num = num + 3;
}
}