Combine TableTools and individual column filtering in the same table

Combine TableTools and individual column filtering in the same table

dnssousadnssousa Posts: 3Questions: 0Answers: 0
edited May 2013 in General
I'd like to know if there is possible combine the TableTools and individual column filtering in the same table.

in the forum there is explanation (link below) but it did not work

could someone help me?

if someone can send a complete and functional, I would be delighted

http://datatables.net/forums/discussion/2883/combine-tabletool-and-individual-column-filtering/p1

Replies

  • dnssousadnssousa Posts: 3Questions: 0Answers: 0
    if someone can send a complete and functional, I would be delighted
  • dnssousadnssousa Posts: 3Questions: 0Answers: 0
    I get to work, see below:

    var asInitVals = new Array();

    $(document).ready(function() {
    var oTable = $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oLanguage": {

    "sSearch": "Search all columns:",

    }
    }
    );


    $("tfoot input").keyup( function () {
    /* Filter on the column (the index) of this element */
    oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );

    /*
    * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
    * the footer
    */
    $("tfoot input").each( function (i) {
    asInitVals[i] = this.value;
    } );

    $("tfoot input").focus( function () {
    if ( this.className == "search_init" )
    {
    this.className = "";
    this.value = "";
    }
    } );

    $("tfoot input").blur( function (i) {
    if ( this.value == "" )
    {
    this.className = "search_init";
    this.value = asInitVals[$("tfoot input").index(this)];
    }
    } );
    } );
This discussion has been closed.