名称标签类型默认描述
radio
data-radio
Boolean
false
是否显示单选radio
checkbox
data-checkbox
Boolean
false
是否显示多选checkbox
field
data-field
String
undefined
该列映射的data的参数名
title
data-title
String
undefined
该列的表头名
titleTooltip
data-title-tooltip
String
undefined
该列表头的title提示文本
class
class / data-class
String
undefined
该列的class
rowspan
rowspan / data-rowspan
Number
undefined
合并单元格时定义合并多少行
colspan
colspan / data-colspan
Number
undefined
合并单元格时定义合并多少列
align
data-align
String
undefined
设置该列数据如何对齐,’left’, ‘right’, ‘center’
halign
data-halign
String
undefined
table header对齐方式, ‘left’, ‘right’, ‘center’
falign
data-falign
String
undefined
table footer对齐方式, ‘left’, ‘right’, ‘center’
valign
data-valign
String
undefined
单元格(cell)对齐方式. ‘top’, ‘middle’, ‘bottom’
width
data-width
Number {Pixels or Percentage}
undefined
列的宽度,可以使用像素或者百分比,不带单位则默认为px
sortable
data-sortable
Boolean
false
该列是否排序(表头显示双箭头)
order
data-order
String
‘asc’
该列默认的排序方式, ‘asc’ or ‘desc’.
visible
data-visible
Boolean
true
该列是否可见
cardVisible
data-card-visible
Boolean
true
在card视图里是否可见
switchable
data-switchable
Boolean
true
列切换是否可见.
clickToSelect
data-click-to-select
Boolean
true
是否选中checkbox或者radio,当该列被选择时
formatter
data-formatter
Function
undefined
格式化单元格内容,function(value, row, index), value:该cell本来的值,row:该行数据,index:该行序号(从0开始)
footerFormatter
data-footer-formatter
Function
undefined
格式化footer内容,function(rows),rows:所有行数据
events
data-events
Object
undefined
The cell 的事件监听,当你使用formatter function的时候,有三个参数: event: the jQuery event. value: 该cell的值 row: 该行的数据 index: 该行的序号
sorter
data-sorter
Function
undefined
自定义字段排序函数,function(a, b)
sortName
data-sort-name
String
undefined
当列中有html等标签时,只排序实际内容(忽略标签和样式),例如字段为:”abc“,则sortName=abc
cellStyle
data-cell-style
Function
undefined
单元格样式,支持css和classes,function(value, row, index) value: 该cell的值 row: 该行的数据 index: 该行的序号
searchable
data-searchable
Boolean
true
搜索时是否搜索此列
searchFormatter
data-search-formatter
Boolean
true
搜索是否使用格式化后的数据(即显示在页面上的数据)
$.TableInit = function(i, total) {
$(‘#table‘).bootstrapTable(‘destroy‘);
$(‘#table‘).bootstrapTable({
data: total[i].children,
striped: true,
cache: false,
buttonsAlign: "right", //按钮对齐方式
pagination: true, //是否显示分页(*)
sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 6, //每页的记录行数(*)
height: 150, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度
columns: [ //{
//field: ‘documentID‘,
//align: ‘center‘,
//title: ‘单据编号‘
// },
{
width:450,
field: ‘processInstName‘,
align: ‘center‘,
//title: ‘流程名称‘,
formatter: function aFormatter(value, row, index) {
return
].join("")
}
}
},
//{
// field: ‘biztypecode‘,
// align: ‘center‘,
//title: ‘单据类型‘
// }, //{
/// field: ‘amount‘,
// align: ‘center‘,
//title: ‘金额‘
// },
{
width:200,
field: ‘time‘,
align: ‘center‘,
// title: ‘时间‘
}, {
width:200,
field: ‘username‘,
align: ‘center‘,
}
]
});
$(".swiper-a").removeClass("todoactived");;
$(".swiper-a").eq(i).addClass("todoactived");
}