{hero}

detectType

Since: DataTables 2.1.6

Ability to enable / disable auto type detection.

Description

DataTables will attempt to automatically determine what data type exists in your table's columns. There is extensive documentation about this available in the manual so for brevity it won't be repeated here. However, this option provides the ability to disable the auto type detection that DataTables performs.

This might be useful if you are using server-side processing where data can change between pages and the client-side is unable to automatically reliably determine a column's data type. Note that you could also specify columns.type which will stop the automatic type detection from running for a column as well.

Type

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

Default

  • Value: true

Example

Disable auto type detection when server-side processing:

new DataTable('#myTable', {
	ajax: '/api/options',
	detectType: false,
	serverSide: true
});

Related

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