columns.columnControl
Specific ColumnControl configurations for columns.
Please note - this property requires the ColumnControl extension for DataTables.
Description
This option can take exactly the same values as columnControl
. However, while that option is applied globally to all columns, this option will be applied only to whatever columns are targeted (columns
or columnDefs
).
It is important to be aware that if you specify column and global options for ColumnControl, the column specific options will overwrite the global ones for matching columns. The options are not merged.
Type
This option can be given in the following type(s):
Examples
Use searchDropdown
in all column headers, except the final column (target: -1
).:
new DataTable('#myTable', {
columnControl: ['searchDropdown'],
columnDefs: [{
target: -1,
columnControl: []
}]
});
Create a search input in the second row of the header, but only for columns which have a class of search
.:
new DataTable('#myTable', {
columnDefs: [{
target: '.search',
columnControl: {
target: 1,
content: ['search']
}
}]
});