The column options is defined in jQuery.fn.bootstrapTable.columnDefaults.
| Name | Attribute | Type | Default | Description |
|---|---|---|---|---|
| radio | data-radio | Boolean | false | True to show a radio. The radio column has fixed width. |
| checkbox | data-checkbox | Boolean | false | True to show a checkbox. The checkbox column has fixed width. |
| field | data-field | String | undefined | The column field name. |
| title | data-title | String | undefined | The column title text. |
| class | class / data-class | String | undefined | The column class name. |
| align | data-align | String | undefined | Indicate how to align the column data. "left', 'right', 'center' can be used. |
| halign | data-halign | String | undefined | Indicate how to align the table header. 'left', 'right', 'center' can be used. |
| falign | data-falign | String | undefined | Indicate how to align the table footer. 'left', 'right', 'center' can be used. |
| valign | data-valign | String | undefined | Indicate how to align the cell data. 'top', 'middle', 'bottom' can be used. |
| width | data-width | Number {Pixels or Percentage} | undefined | The 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 |
| sortable | data-sortable | Boolean | false | True to allow the column can be sorted. |
| order | data-order | String | 'asc' | The default sort order, can only be 'asc' or 'desc'. |
| visible | data-visible | Boolean | true | False to hide the columns item. |
| cardViewVisible | data-card-visible | Boolean | true | False to hide the columns item in card view state. |
| switchable | data-switchable | Boolean | true | False to disable the switchable of columns item. |
| clickToSelect | data-click-to-select | Boolean | true | True to select checkbox or radiobox when the column is clicked. |
| formatter | data-formatter | Function | undefined |
The cell formatter function, take three parameters: value: the field value. row: the row record data. index: the row index. |
| footerFormatter | data-footer-formatter | Function | undefined |
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. |
| events | data-events | Object | undefined |
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. |
| sorter | data-sorter | Function | undefined |
The custom field sort function that used to do local sorting, take two parameters: a: the first field value. b: the second field value. |
| sortName | data-sort-name | String | undefined | Provide 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". |
| cellStyle | data-cell-style | Function | undefined |
The cell style formatter function, take three parameters: value: the field value. row: the row record data. index: the row index. Support classes or css. |
| searchable | data-searchable | Boolean | true | True to search data for this column. |