Custom range filtering with multiple DataTables on a given page

Custom range filtering with multiple DataTables on a given page

BLSullyBLSully Posts: 24Questions: 1Answers: 0
edited July 2012 in DataTables 1.9
Please forgive me if I'm misinterpreting how to use this, but I've got multiple DataTables in a single page, however, I would only like to apply custom (date) range filtering to a single table. Looking through the documentation, it seems that this exact requirement is covered by $.fn.dataTableExt.afnFiltering. (http://www.datatables.net/examples/plug-ins/range_filtering.html)

However, that's pushing a filtering function onto an array that lives in 'static' space, not a given DataTables instance. I don't want that filtering function to effect other tables that may exist in the same page.

This can't be that hard, what am I missing?

EDIT: I'm not looking for code samples, just 'best approach' suggestions. Thanks :)

EDIT 2: Might i suggest that .fnFilter get an additional option on the first parameter to be a function, so you could do something like....
[code]
.fnFilter(function(sData){
if(sData >= $('#input1').val() && sData <= $('#input2).val())
return true;
else
return false;
}, 3)
[/code]

Replies

  • BLSullyBLSully Posts: 24Questions: 1Answers: 0
    Oh... Well just going to respond to this in case someone else runs across this question...

    Someone was kind enough to create this functionality already... I just didn't look hard enough in the Extras section....

    http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html
This discussion has been closed.