Jquery UI slider

Jquery UI slider

jsamuel89jsamuel89 Posts: 14Questions: 0Answers: 0
edited May 2012 in DataTables 1.8
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.

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    edited May 2012
    So if I understand you correctly:

    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]
This discussion has been closed.