Apply more than one range filter
Apply more than one range filter
noslan
Posts: 29Questions: 0Answers: 0
Actually I'm using this function to generate a range filter in datatables:
[code]
function CreaFiltro(min,max,col){
var oTable = $('#example').dataTable();
$.fn.dataTableExt.afnFiltering.push(
function(oSettings, aData, iDataIndex) {
var engineColumn = parseInt(aData[col]);
if (engineColumn >= min && engineColumn <= max)
return true;
return false;
})
oTable.fnDraw();
$.fn.dataTableExt.afnFiltering.pop();
}
[/code]
It works fine, but I need to apply a second range filter using a function, is it possible? any suggestion?
Thanks!
[code]
function CreaFiltro(min,max,col){
var oTable = $('#example').dataTable();
$.fn.dataTableExt.afnFiltering.push(
function(oSettings, aData, iDataIndex) {
var engineColumn = parseInt(aData[col]);
if (engineColumn >= min && engineColumn <= max)
return true;
return false;
})
oTable.fnDraw();
$.fn.dataTableExt.afnFiltering.pop();
}
[/code]
It works fine, but I need to apply a second range filter using a function, is it possible? any suggestion?
Thanks!
This discussion has been closed.
Replies
Allan