Las opciones de la tabla están definidas en jQuery.fn.bootstrapTable.defaults.
| Nombre | Atributo | Tipo | Valor por defecto | Descripción |
|---|---|---|---|---|
| - | data-toggle | String | 'table' | Activa bootstrap table sin escribir código JavaScript. |
| classes | data-classes | String | 'table table-hover' | El nombre de la clase de la tabla. |
| height | data-height | Number | undefined | El alto de la tabla. |
| undefinedText | data-undefined-text | String | '-' | Define el texto por defecto. |
| striped | data-striped | Boolean | false | True para stripe las filas. |
| sortName | data-sort-name | String | undefined | Define cuales columnas pueden ser ordenadas. |
| sortOrder | data-sort-order | String | 'asc' | Define el método de ordenamiento, solo puede ser 'asc' o 'desc'. |
| iconsPrefix | data-icons-prefix | String | 'glyphicon' | Define el nombre del icono ('glyphicon' o 'fa' para FontAwesome). Por defecto se usa 'glyphicon'. |
| icons | data-icons | Object | { refresh: 'glyphicon-refresh icon-refresh', toggle: 'glyphicon-list-alt icon-list-alt', columns: 'glyphicon-th icon-th' } |
Define los iconos que son usados para los botones de refresh, toggle y columnas. |
| columns | - | Array | [] | El array de columnas de la tabla, vea las propiedades de las columnas para más información. |
| data | - | Array | [] | Los datos que serán cargados. |
| method | data-method | String | 'get' | El tipo de método para hacer request de los datos remotos. |
| url | data-url | String | undefined | Una URL para hacer request de datos en un sitio remoto. |
| cache | data-cache | Boolean | true | False para deshabilitar los AJAX requests. |
| contentType | data-content-type | String | 'application/json' | EL contentType para hacer request de los datos. |
| dataType | data-data-type | String | 'json' | El tipo de datos que se esperan del servidor. |
| ajaxOptions | data-ajax-options | Object | {} | Additional options for submit ajax request. List of values: http://api.jquery.com/jQuery.ajax. |
| queryParams | data-query-params | Function | function(params) { return params; } |
When requesting remote data, you can send additional parameters by modifying queryParams.
If queryParamsType = 'limit', the params object contains: limit, offset, search, sort, order Else, it contains: pageSize, pageNumber, searchText, sortName, sortOrder. Return false to stop request. |
| queryParamsType | data-query-params-type | String | 'limit' | Set 'limit' to send query params width RESTFul type. |
| responseHandler | data-response-handler | Function | function(res) { return res; } |
Before load remote data, handler the response data format, the parameters object contains: res: the response data. |
| pagination | data-pagination | Boolean | false | True to show a pagination toolbar on table bottom. |
| sidePagination | data-side-pagination | String | 'client' | Defines the side pagination of table, can only be 'client' or 'server'. |
| pageNumber | data-page-number | Number | 1 | When set pagination property, initialize the page number. |
| pageSize | data-page-size | Number | 10 | When set pagination property, initialize the page size. |
| pageList | data-page-list | Array | [10, 25, 50, 100] | When set pagination property, initialize the page size selecting list. |
| selectItemName | data-select-item-name | String | 'btSelectItem' | The name of radio or checkbox input. |
| smartDisplay | data-smart-display | Boolean | true | True to display pagination or card view smartly. |
| search | data-search | Boolean | false | Enable the search input. |
| searchTimeOut | data-search-time-out | Number | 500 | Set timeout for search fire. |
| showHeader | data-show-header | Boolean | true | False to hide the table header. |
| showColumns | data-show-columns | Boolean | false | True to show the columns drop down list. |
| showRefresh | data-show-refresh | Boolean | false | True to show the refresh button. |
| showToggle | data-show-toggle | Boolean | false | True to show the toggle button to toggle table / card view. |
| minimumCountColumns | data-minimum-count-columns | Number | 1 | The minimum count columns to hide of the columns drop down list. |
| idField | data-id-field | String | undefined | Indicate which field is an identity field. |
| cardView | data-card-view | Boolean | false | True to show card view table, for example mobile view. |
| searchAlign | data-search-align | String | 'right' | Indicate how to align the search input. 'left', 'right' can be used. |
| buttonsAlign | data-buttons-align | String | 'right' | Indicate how to align the toolbar buttons. 'left', 'right' can be used. |
| toolbarAlign | data-toolbar-align | String | 'left' | Indicate how to align the custom toolbar. 'left', 'right' can be used. |
| clickToSelect | data-click-to-select | Boolean | false | True to select checkbox or radiobox when click rows. |
| singleSelect | data-single-select | Boolean | false | True to allow checkbox selecting only one row. |
| toolbar | data-toolbar | String | undefined |
A jQuery selector that indicate the toolbar, for example: #toolbar, .toolbar. |
| checkboxHeader | data-checkbox-header | Boolean | true | False to hide check-all checkbox in header row. |
| maintainSelected | data-maintain-selected | Boolean | false | True to maintain selected rows on change page and search. |
| sortable | data-sortable | Boolean | true | False to disable sortable of all columns. |
| rowStyle | data-row-style | Function | {} |
The row style formatter function, take two parameters: row: the row record data. index: the row index. Support classes or css. |
| rowAttributes | data-row-attributes | Function | {} |
The row attribute formatter function, take two parameters: row: the row record data. index: the row index. Support all custom attributes. |