two different range filters on a table.

two different range filters on a table.

wallauschekwallauschek Posts: 1Questions: 0Answers: 0
edited October 2011 in Plug-ins
need to do two different range filters in two columns from one table.
what to put on probation(if):

Something like:

[code] $.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {

if(){
var iMin = $('#ano option:selected').val() * 1;
var iMax = $('#ano2 option:selected').val() * 1;

var iVersion = aData[8];
iVersion == "-" ? 0 : iVersion*1;
}else{
var iMin = $('#minimo option:selected').val() * 1;
var iMax = $('#maximo option:selected').val() * 1;

var iVersion = aData[9].replace('.','');
iVersion == "-" ? 0 : iVersion*1;
}

if ( iMin == "" && iMax == "" )
{
return true;
}
else if ( iMin == "" && iVersion < iMax )
{
return true;
}
else if ( iMin <= iVersion && "" == iMax )
{
return true;
}
else if ( iMin <= iVersion && iVersion <= iMax )
{
return true;
}
return false;
}
); [/code]
This discussion has been closed.