Custom range filtering with multiple DataTables on a given page
Custom range filtering with multiple DataTables on a given page
BLSully
Posts: 24Questions: 1Answers: 0
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]
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]
This discussion has been closed.
Replies
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