{hero}

columns.searchPanes.preSelect

Since: SearchPanes SearchPanes 1.0.0

Pre-selected options in a pane.
Please note - this property requires the SearchPanes extension for DataTables.

Description

As standard, SearchPanes will not pre-select any values in any of the panes.

If any of the elements in the array held in columns.searchPanes.preSelect are present in the pane then they will be pre-selected.

Note: searchPanes.preSelect is not supported with searchPanes.cascadePanes. This is because in order to have the cascade operate as expected the selections need to be made in the correct order. Currently it is not possible to indicate this with preSelect.

Type

Array

Description:

By setting the columns.searchPanes.preSelect option to an array of string values, the pane produced for that column will be searched and if the values of the columns.searchPanes.preSelect option are found then they will be pre-selected.

Default

  • Value: undefined

The default value for the columns.searchPanes.preSelect parameter is undefined. When this default value is in place, no values will be preSelected in the pane.

Example

Pre-select values in a pane:

$(document).ready(function() {
    $('#example').DataTable({
        dom: 'Plfrtip',
        columnDefs: [
            {
                searchPanes: {
                    preSelect: ['Edinburgh','London']
                },
                targets: [3]
            }
        ]
    });
});