列参数

列参数定义在 jQuery.fn.bootstrapTable.columnDefaults

名称标签类型默认描述
radiodata-radioBooleanfalseTrue to show a radio. The radio column has fixed width.
checkboxdata-checkboxBooleanfalseTrue to show a checkbox. The checkbox column has fixed width.
fielddata-fieldStringundefinedThe column field name.
titledata-titleStringundefinedThe column title text.
titleTooltipdata-title-tooltipStringundefinedThe column title tooltip text. This option also support the title HTML attribute
classclass / data-classStringundefinedThe column class name.
rowspanrowspan / data-rowspanNumberundefinedIndicate how many rows a cell should take up.
colspancolspan / data-colspanNumberundefinedIndicate how many columns a cell should take up.
aligndata-alignStringundefinedIndicate how to align the column data. 'left', 'right', 'center' can be used.
haligndata-halignStringundefinedIndicate how to align the table header. 'left', 'right', 'center' can be used.
faligndata-falignStringundefinedIndicate how to align the table footer. 'left', 'right', 'center' can be used.
valigndata-valignStringundefinedIndicate how to align the cell data. 'top', 'middle', 'bottom' can be used.
widthdata-widthNumber {Pixels or Percentage}undefinedThe width of column. If not defined, the width will auto expand to fit its contents. Also you can add '%' to your number and the bootstrapTable will use the percentage unit, otherwise, you can add or no the 'px' to your number and then the bootstrapTable will use the pixels
sortabledata-sortableBooleanfalseTrue to allow the column can be sorted.
orderdata-orderString'asc'The default sort order, can only be 'asc' or 'desc'.
visibledata-visibleBooleantrueFalse to hide the columns item.
cardVisibledata-card-visibleBooleantrueFalse to hide the columns item in card view state.
switchabledata-switchableBooleantrueFalse to disable the switchable of columns item.
clickToSelectdata-click-to-selectBooleantrueTrue to select checkbox or radiobox when the column is clicked.
formatterdata-formatterFunctionundefined The context (this) is the column Object. The cell formatter function, take three parameters: value: the field value. row: the row record data. index: the row index.
footerFormatterdata-footer-formatterFunctionundefined The context (this) is the column Object. The function, take one parameter: data: Array of all the data rows. the function should return a string with the text to show in the footer cell.
eventsdata-eventsObjectundefined The cell events listener when you use formatter function, take three parameters: event: the jQuery event. value: the field value. row: the row record data. index: the row index.
sorterdata-sorterFunctionundefined The custom field sort function that used to do local sorting, take two parameters: a: the first field value. b: the second field value. rowA: the first row. rowB: the second row.
sortNamedata-sort-nameStringundefinedProvide a customizable sort-name, not the default sort-name in the header, or the field name of the column. For example, a column might display the value of fieldName of "html" such as "<b><span style="color:red">abc</span></b>", but a fieldName to sort is "content" with the value of "abc".
cellStyledata-cell-styleFunctionundefined The cell style formatter function, take three parameters: value: the field value. row: the row record data. index: the row index. field: the row field. Support classes or css.
searchabledata-searchableBooleantrue True to search data for this column.
searchFormatterdata-search-formatterBooleantrue True to search use formated data.
escapedata-escapeBooleanfalse Escapes a string for insertion into HTML, replacing &, <, >, ", `, and ' characters.
showSelectTitledata-show-select-titleBooleanfalse True to show the title of column with 'radio' or 'singleSelect' 'checkbox' option.