{hero}

ordering

Since: DataTables 1.10

Feature control ordering (sorting) abilities in DataTables.

Description

This option sets whether columns can be ordered or not in DataTables. By default, DataTables allows end users to click on the header cell for each column, ordering the table by the data in that column. The ability to order data can be disabled using this option.

Note that the ability to add or remove sorting of individual columns can be disabled by the columns.orderable option for each column. This parameter is a global option - when disabled, there are no sorting actions applied by DataTables at all.

As of DataTables 2.3 this option can also be given as an object to allow more nuanced customisation of the ordering controls that DataTables adds to the table. This is particularly of interest if you are using an extension such as ColumnControl to control column ordering. If given as an object, ordering is enabled in the table.

Types

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

Default

true

Examples

Disable ordering in the table:

new DataTable('#myTable', {
	ordering: false
});

Keep ordering enabled, but disable the built in click listeners:

new DataTable('#myTable', {
	ordering: {
		handler: false
	}
});

Related

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