cardView

Since: CardView 1.0.0

Change the display to display the cards.
Please note - this property requires the CardView extension for DataTables.

Description

This button will trigger CardView's card view, and hide the table. This is true regardless of responsive page width, and the card view will be retained until the display mode is changed (cardView().mode() or one of the other similar buttons).

Note that when the cards are shown (not the mode!), this button will be shown as active.

Options

This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text):

text

  • Type: string
  • Default: View cards

The button's display text. The text can be configured using this option (see buttons.buttons.text) or use the buttons.cardView option of the DataTables language object.

Example

View specific buttons:

new DataTable('#myTable', {
	cardView: true,
	layout: {
		topStart: {
			buttons: ['cardView', 'tableView', 'autoView']
		}
	}
});