Functionality ideas
Functionality ideas
Hi',
I'm trying ColumnControl instead of manually manage column filters and I'd like to post some idea!
- An option to globally disabled the logic section (workaround via css)
- When the "inputmode" is set to "numeric" also set the type of the input as "number"
- Permit the use of normal select as column filter, actual workaround:
DataTable.ColumnControl.content['searchSelect'] = {
defaults: { options: [], placeholder: '' },
init: function(cfg) {
const dt = this.dt();
const colIdx = this.idx();
const select = document.createElement('select');
select.classList.add('dtcc-search-select');
// crea la tendina con la configurazione data
cfg.options.forEach(function(opt) {
const option = document.createElement('option');
option.value = opt.value !== undefined ? opt.value : opt;
option.textContent = opt.label !== undefined ? opt.label : opt;
select.appendChild(option);
});
...
return select;
}
};
...
const states = [
{ "label": "All", "value": "" },
{"label": "Working", value: "0"},
...
];
myTable = new DataTable('#table', {
{
target: 4,
columnControl: [{
extend: 'searchSelect',
options: states
}]
}
]
});
Thanks in advance!
Federico
This question has an accepted answers - jump to answer
Answers
Hi Federico,
Thanks for your message.
excludeLogicoption exists on the search content types (e.g.-content searchText), but for a complete disablement, a CSSdisplay: noneon theselectis probably the best option at the moment. I'll look at adding an option for that.-content searchListis currently the way to show a clickable list of options, but I can see that a simpleselectcould be useful. That could certainly be added as a content type.Many thanks for the suggestions!
Allan
Thanks Allan!
I'll try to ask also another suggestion!
With datatable is possibile to define a column not searchable with data-searchable html attribute. It would be interesting if ColumnControl would rely on this attribute to not add search fields in those columns
At the moment I've taken the view that a ColumnControl search doesn't align with the
.
searchableoption - although I can see the benefit of adding that. Let me think about that one a bit and the ramificationsAllan