layout: docs title: Table Filter Control description: Table Filter Control extension of Bootstrap Table. group: extensions
Dependence if you use the datepicker option: bootstrap-datepicker v1.4.0
{% highlight html %} {% endhighlight %}
Attribute: data-filter-control
type: Boolean
Detail:
Set to true to add an input or select into the column.
falseAttribute: data-filter-control-visible
type: Boolean
Detail:
Set to false to hide the filter controls.
trueAttribute: data-alignment-select-control-options
type: String
Detail:
Set the alignment of the select control options. Use Use left, right or auto.
undefinedAttribute: data-disable-control-when-search
type: Boolean
Detail:
Set to true if you want to disable the control while the server is responding the data. This options will work if the sidePagination is 'server'.
falseAttribute: data-filter-control-container
type: Selector
Detail:
Set to e.g. #filter to allow custom input filter in a element with the id filter.
Each filter element (input or select) must have the following class bootstrap-table-filter-control-<FieldName> ( must be replaced with the defined Field name).
falseAttribute: data-filter-data-collector
type: Function
Detail:
Collect data which will added to the select filter, to filter through e.g. labels which are comma separated and displayed with a formatter.
undefinedAttribute: data-hide-unused-select-options
type: Boolean
Detail:
Set to true in order to hide the options that are not in the table. This option does not work on server-side pagination.
falseAttribute: data-search-on-enter-key
type: Boolean
Detail:
Set to true to fire the search action when the user press the enter key.
falseAttribute: data-show-filter-control-switch
type: Boolean
Detail:
Set to true to show the filter control switch button.
falseAttribute: data-filter-control
type: String
Detail:
Set input: show an input control, select: show a select control, datepicker: show a datepicker control.
undefinedattribute: data-filter-control-placeholder
type: String
Detail:
Set this in order to show a placeholder only in the input filter control.
''Attribute: data-filter-custom-search
type: function
Detail:
The custom search function is executed instead of built-in search function, takes four parameters:
* `text`: the search text.
* `value`: the the value of the column to compare.
* `field`: the column field name.
* `data`: the table data.
Return false to filter out the current column/row.
Return true to not filter out the current column/row.
Return null to skip the custom search for the current value.
undefinedAttribute: data-filter-data
type: String
Detail:
Set custom select filter values, use
var:variable to load from a variable
obj:variable.key to load from a object
url:http://www.example.com/data.json to load from a remote json file
json:{key:data} to load from a json string.
func:functionName to load from a function.
undefinedAttribute: data-filter-datepicker-options
type: Object
Detail:
If the datepicker option is set use this option to configure the datepicker with the native options. Use this way: data-filter-datepicker-options='{"autoclose":true, "clearBtn": true, "todayHighlight": true}'.
undefinedAttribute: data-filter-default
type: String
Detail:
Set the default value of the filter.
If you use the datepicker, make sure your date format match the format of the datepicker. You can change the datepicker format using filterDatepickerOptions.
undefinedattribute: data-filter-order-by
type: String
Detail:
Set this to order the options in a select control whether ascending ('asc'), descending ('desc') or in the order provided by the server ('server').
'asc'attribute: data-filter-starts-with-search
type: Boolean
Detail:
Set to true if you want to use the starts with search mode.
falseAttribute: data-filter-strict-search
type: Boolean
Detail:
Set to true if you want to use the strict search mode.
false'glyphicon-trash icon-clear''glyphicon-zoom-out icon-zoom-out''glyphicon-zoom-in icon-zoom-in'type: Function
Default: function () { return "Clear Filters" }
type: Function
Default: function () { return "Hide/Show controls" }
type: Function
Default: function () { return "Hide controls" }
type: Function
Default: function () { return "Show controls" }