cardView

Since: CardView 1.0.0

Enable and configure the CardView extension for DataTables.
Please note - this property requires the CardView extension for DataTables.

Description

This option provides the ability to enable and configure CardView for DataTables. In its simplest form as the boolean true it will enable CardView with the default configuration options (as defined by DataTable.CardView.defaults). It can also be used as an object to provide custom configuration options as described below.

Please note that as with all other configuration options for CardView, this option is an extension to the default set of DataTables options. This property should be set in the DataTables initialisation object.

Types

boolean

As a boolean value this property will enable CardView on the DataTable that is being created. true will enable CardView, while false will not.

This is a short-cut option to enable CardView with the default configuration options. Customisations can be made by giving this parameter as an object, see below.

object

If given as an object, CardView will be enabled on the target DataTable, with default values (DataTable.CardView.defaults) extended, and potentially overwritten, by the options provided in this object. This is how CardView can be configured on an individual table basis, or through the defaults.

Default

  • Value: undefined

CardView will not be initialised by default

Examples

Enable CardView for a table:

new DataTable('#myTable', {
	cardView: true
});

Enable CardView with configuration options:

new DataTable('#myTable', {
	cardView: {
		mode: 'cards'
	}
});