cardView-mode
Since: CardView 1.0.0
The CardView mode has changed.
Please note - this property requires the CardView extension for DataTables.
Description
This event can be used to listen for when the display mode of CardView changes (via a button or the cardView().mode() method).
Please note that this event might, or might not, change the view of the DataTable (e.g. if entering auto mode, the view might not need to change). To know when the display changes between cards and table, use the cardView-display event.
Type
function( e, mode )
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | e | No | |
Event object | |||
| 2 | mode | No | |
This parameter will be set to the mode that CardView has changed to. It will be one of:
| |||
Example
Show a message when the view mode changes:
let table = new DataTable('#myTable', {
cardView: true
});
table.on('cardView-mode', function (e, mode) {
console.log('CardView mode change:', mode);
});Related
The following options are directly related and may also be useful in your application development.