Skip to content

Commit 8871f34

Browse files
committed
feat: miglioramento colonne Datatables non filtrabili
1 parent 7481dd9 commit 8871f34

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

assets/src/js/functions/datatables.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function initComplete(settings) {
287287
const $this = $(this);
288288
const search = getTableSearch();
289289

290-
api.columns('.search').every(function () {
290+
api.columns().every(function () {
291291
const column = this;
292292

293293
// Valore predefinito della ricerca
@@ -296,9 +296,14 @@ function initComplete(settings) {
296296
const header = $(column.header());
297297
const name = header.attr('id').replace('th_', '');
298298

299+
if ($(header).hasClass('select-checkbox')){
300+
return true;
301+
}
302+
const searchable = $(header).hasClass('search');
303+
299304
const value = search[(id_plugin ? id_plugin : "") + "_search_" + name] ? search[(id_plugin ? id_plugin : "") + "_search_" + name] : '';
300305

301-
$('<br><input type="text" style="width:100%" class="form-control' + (value ? ' input-searching' : '') + '" placeholder="' + globals.translations.filter + '..." value="' + value.replace(/"/g, '&quot;') + '"><i class="deleteicon fa fa-times' + (value ? '' : ' hide') + '"></i>')
306+
$('<br><input type="text" style="width:100%" class="form-control' + (value ? ' input-searching' : '') + (searchable ? '' : ' disabled') + '" placeholder="' + globals.translations.filter + '..." value="' + value.replace(/"/g, '&quot;') + '"' + (searchable ? '' : ' disabled') + '><i class="deleteicon fa fa-times' + (value ? '' : ' hide') + '"></i>')
302307
.appendTo(column.header())
303308
.on('keyup', function (e) {
304309
clearInterval(tempo);

0 commit comments

Comments
 (0)