tablesorter
tablesorter copied to clipboard
filter_startsWith in one column only
i want only the column 3 to be filtered with startsWith, i made a filter_function but the or operator is not working anymore
widgetOptions: {
filter_searchDelay: 0,
filter_columnFilters: true,
//filter_startsWith: true,
filter_functions: {
3: function (e, n, f, i, $r, c, data) {
let res = false;
f.split("|").forEach((ff) => {
if (e.startsWith(ff))
res = true;
});
return res;
},
},
},
Try this:
filter_functions: {
3: function (e, n, f, i, $r, c, data) {
return f.split("|").some(ff => e.startsWith(ff));
},
},