{hero}

ordering.handler

Since: DataTables 2.3

Control the click to order listener for column headers.

Description

When ordering is enabled for a DataTable you need a way for the end user to activate ordering on a column's data. This option controls the built in handler for that in DataTables. If enabled a listener is added to header cells (both click and for accessability the enter key) that will trigger ordering on a column.

It can be useful to disable this ability if you wish to use an extension such as ColumnControl to control column ordering.

If this option is disabled, the header cells for the table do not show a pointer cursor when hovered over (the classes dt-orderable-desc and dt-orderable-asc are removed).

It is worth highlighting that this option interacts with columns.orderable: if disabled, the listener is not added.

Type

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

Default

true

Example

Disable the built in order listener:

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

Related

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