{hero}

searchPanes.viewTotal

Since: SearchPanes SearchPanes 1.0.0

Update the count column when searching to show visible count.
Please note - this property requires the SearchPanes extension for DataTables.

Description

By setting the searchPanes.viewTotal parameter to true, the message displayed in the count column will change when a search is applied to the DataTable.

As standard, SearchPanes will set the count column to display the total number of different values visible in the column when no filtering is applied. When filtering is active the count column will display the number of entries that satisfy this condition currently on display followed in brackets by the total in the table which satisfy the condition.

This is useful for seeing which options actually have entries present in the table when it has been searched upon.

It is possible to adjust the messages shown both when searching is taking place and when it isn't, by using the language.seearchPanes.count and language.searchPanes.countFiltered options. The language.searchPanes.countFiltered message will only be shown when searchPanes.viewtotal is set to true, otherwise only language.seearchPanes.count will be shown.

Note: When loading SearchPanes options over ajax, but then using serverSide processing, neither searchPanes.viewTotal or searchPanes.cascadePanes are supported. This is due to the requirements for users to procide accurate data for the SearchPanes options, whos values change when using these two options. While it is still possible to enable these options, it is not advised and may lead to unexpected behaviour.

Type

boolean

Description:

By setting the searchPanes.viewTotal to true, when a search is applied to the table, the message in the count columns of the panes will change to represent the currently visible entries.

Default

  • Value: false

The default value for the searchPanes.viewTotal parameter is false.

Example

Enable viewTotal:

$(document).ready(function() {
    $('#example').DataTable({
        searchPanes: {
            viewTotal: true
        },
        dom: 'Plfrtip'
    });
});

Related

The following options are directly related and may also be useful in your application development.