{hero}

columns.orderSequence

Since: DataTables 1.10

Order direction application sequence.

Description

You can control the default ordering direction, and even alter the behaviour of the order handler (i.e. only allow ascending sorting etc) using this parameter.

Type

This option can be given in the following type(s):

Default

  • Value: [ 'asc', 'desc' ]

Examples

Using orderSequence to define the applied order sequence with columnDefs:

$('#example').dataTable( {
  "columnDefs": [
    { "orderSequence": [ "asc" ], "targets": [ 1 ] },
    { "orderSequence": [ "desc", "asc", "asc" ], "targets": [ 2 ] },
    { "orderSequence": [ "desc" ], "targets": [ 3 ] }
  ]
} );

Using orderSequence to define the applied order sequence with columns:

$('#example').dataTable( {
  "columns": [
    null,
    { "orderSequence": [ "asc" ] },
    { "orderSequence": [ "desc", "asc", "asc" ] },
    { "orderSequence": [ "desc" ] },
    null
  ]
} );

Related

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