Jquery UI slider
Jquery UI slider
jsamuel89
Posts: 14Questions: 0Answers: 0
Hi
I have a awesome datatable working.I want to add a jquery UI range filter for a particular column of the datatable.How to do that??i am strucked there.
I have a awesome datatable working.I want to add a jquery UI range filter for a particular column of the datatable.How to do that??i am strucked there.
This discussion has been closed.
Replies
1) you have a jQuery UI slider on your page (http://jqueryui.com/demos/slider/)
2) the user drags this slider to a certain position, thus creating some value, e.g. '50%' (if the slider is in the middle)
3) you want to show all rows having a value of '50%' for a certain column?
In that case:
[code]
$(document).ready(function() {
var oTable = $('#example').dataTable();
// Sometime later - filter...
var iMyColumnIndex = 0;
var sMyValueToFilter = jQuery('#mySlider').slider( "value").toString();
oTable.fnFilter(sMyValueToFilter , iMyColumnIndex );
} );
[/code]