Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Custom filter does not work

$
0
0

Hi

I need to create a custom filter with the following requirements:
- I want the quick filter text field in the top right corner to still work
- I have certain rows where column 3 is set to "on" that should always be displayed

So far I have tried with:

$.fn.dataTable.ext.search.push(
function (settings, searchData, index, rowData, counter) {
if (searchData[3] == "on")
return true;
return false;
}
);

However it does not work since I guess both the standard filter and this filter will remove rows.

My idea so far is to:
Instead of pushing this filter to the array maybe I can replace the current filter? If so I need to add logic so that I will search for the text entered in the text field. But how can I from the filter retrieve the standard quick search text field value?

Is it doable?


Viewing all articles
Browse latest Browse all 2364

Trending Articles