title
Show title / information text.
Please note - this property requires the ColumnControl extension for DataTables.
Description
You may wish to display a title or information text in a dropdown to help explain to your users what options they have and what the controls do. This content type provides that ability, inserting a non-interactive, read-only, div
into the ColumnControl content list, with a string you define.
Display
It is expected that this content type will be used in a dropdown, not at the top level.
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
):
className
- Type:
string
- Default:
dtcc-title
Class name applied to the containing element.
text
- Type:
string
- Default: ``
Text to display in the display element. If no value is given, the column title is used. Note that you can use [title]
in your string, which will be replaced by the column title.
Examples
Show the column title at the top of a dropdown:
new DataTable('#example', {
columnControl: [['title', 'orderAsc', 'orderDesc']]
});
Custom text with replacement of the column title:
new DataTable('#example', {
columnControl: [[
{
extend: 'title',
text: 'Controls for: [title]'
},
'orderAsc',
'orderDesc'
]]
});