columns.orderDataType

Since: DataTables 1.10

Live DOM sorting type assignment.

Description

DataTables' primary order method (the ordering feature) makes use of data that has been cached in memory rather than reading the data directly from the DOM every time an order is performed for performance reasons (reading from the DOM is inherently slow). However, there are times when you do actually want to read directly from the DOM, acknowledging that there will be a performance hit, for example when you have form elements in the table and the end user can alter the values. This configuration option is provided to allow plug-ins to provide this capability in DataTables.

Please note that there are no columns.orderDataType plug-ins built into DataTables, they must be added separately. See the DataTables sorting plug-ins page for further information.

Type

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

Examples

Set live data sort type with columnDefs:

$('#example').dataTable( {
  "columnDefs": [
    { "orderDataType": "dom-text", "targets": [ 2, 3 ] },
    { "type": "numeric", "targets": 3 },
    { "orderDataType": "dom-select", "targets": 4 },
    { "orderDataType": "dom-checkbox", "targets": 5 }
  ]
} );

Set live data sort type with columns:

$('#example').dataTable( {
  "columns": [
    null,
    null,
    { "orderDataType": "dom-text" },
    { "orderDataType": "dom-text", "type": "numeric" },
    { "orderDataType": "dom-select" },
    { "orderDataType": "dom-checkbox" }
  ]
} );

Related

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