fnFilter
fnFilter
dinmor1337
Posts: 4Questions: 0Answers: 0
I have a table with alot of numbers, and i want to filter it so that it shows everything above my value
so if the value is lets say 11 i want it to show all with a number higher than 11, right now it shows values that contains 11. eg. 111, 211 etc.
var iValue = jQuery('#div').slider("value");
iTable.fnFilter(iValue , 1 );
so if the value is lets say 11 i want it to show all with a number higher than 11, right now it shows values that contains 11. eg. 111, 211 etc.
var iValue = jQuery('#div').slider("value");
iTable.fnFilter(iValue , 1 );
This discussion has been closed.
Replies
http://www.datatables.net/release-datatables/examples/plug-ins/range_filtering.html
Are you using the Jquery Slider? If so there are a few posts on here about using it with DataTables
This is an example of a filter you can use. I modified the example on the site.
[code]
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
//min value
var iSlider = $('#slider').slider( "value" );
//column to sort on
var iVersion = aData[3] == "-" ? 0 : aData[3]*1;
if ( iSlider == "")
{
return true;
}
else if ( iVersion >= iSlider )
{
return true;
}
return false;
}
);
[/code]
I also posted an example on jsbin of using the Slider and datatables. I ran into a few issues but is this what you are looking for?
http://live.datatables.net/usobox
like this:
$(document).ready(function() {
oTable = $('#example').dataTable(
{
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "processing.php"
}
Allan