{hero}

searchPanes.order

Since: SearchPanes SearchPanes 1.1.0

Set the order of the Panes.
Please note - this property requires the SearchPanes extension for DataTables.

Description

By setting the searchPanes.order to an array of the columns.searchPanes.name property of the SearchPanes, the panes are displayed in that order.

By default the columns.searchPanes.name is set to be the title of the column. This can be overridden if desired. This is particularly useful for mixing custom and auto generated panes. If the searchPanes.order property is set then any panes that would normally have shown but are not present in the array will not be shown at all.

Type

string

Description:

By setting the searchPanes.order to an array of the columns.searchPanes.name property of the SearchPanes, the panes are displayed in that order.

By default the columns.searchPanes.name is set to be the title of the column, or the searchPanes.panes.header value for custom Panes. This can be overridden if desired.

Default

  • Value: false

The default value for the searchPanes.layout parameter is columns-3.

Examples

Set the order of the panes:

$(document).ready(function() {
    $('#example').DataTable( {
        searchPanes: {
            order: ['Age', 'Office', 'Position']
        },
        dom: 'Pfrtip'
    });
});

Set the order of the panes including a custom name:

$(document).ready(function() {
    $('#example').DataTable( {
        searchPanes: {
            order: ['Length of Life', 'Office', 'Position']
        },
        columnDefs:[
            {
                searchPanes: {
                    name: 'Length of Life'
                },
                targets: [3]
            }
        ],
        dom: 'Pfrtip'
    });
});

Related

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