searchBuilder.filterChanged
Function to update title text when selections are made.
Please note - this property requires the SearchBuilder extension for DataTables.
Description
This function is called every time the number of SearchBuilder conditions that are active changes. As default this is used to update the SearchBuilder title (set using the language.searchBuilder.title
config option alongside an i18n()
API call).
The SearchBuilder button also uses this configuration option to update the button text to reflect the selection numbers (text is set using language.searchBuilder.button
and an i18n()
API call).
The context of the function is the DataTables instance, meaning that API methods can be called directly from within the function. For example, this.i18n(...);
.
Type
function searchBuilder.filterChanged(count)
- Parameters:
Name Type Optional 1 count
No Number of options selected in SearchBuilder.
Example
Set text for custom element:
new DataTable('#myTable', {
layout: {
top1: {
searchBuilder: {
filterChanged: function (count) {
$('.SBDetails').text(
table.i18n(
'searchBuilder.collapse',
{ 0: 'AdvancedFilter', _: 'Advancedfilter (%d)' },
count
)
);
}
}
}
}
});