Individual column filtering (using "input" elements) in multiple tables

Individual column filtering (using "input" elements) in multiple tables

fernandonaimfernandonaim Posts: 9Questions: 0Answers: 0
edited June 2013 in Plug-ins
Help!

How to put the filter in two different tables on the same page?

Thank you!

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    You want one filter for two tables?
  • fernandonaimfernandonaim Posts: 9Questions: 0Answers: 0
    No, I have three tables and I want to put filters ...

    [code]
    oTable1 = $('#tabListaProfFaseOrcamentos').dataTable
    ...












    oTable2 = $('#tabListaEquiFaseOrcamentos').dataTable
    ...












    oTable3 = $('#tabListaMatFaseOrcamentos').dataTable
    ...











    [/code]

    But only works oTable1;
    I think have to change the js below:

    [code]
    var asInitVals = new Array();
    $(document).ready(function() {

    $("tfoot input").keyup( function () {
    /* Filter on the column (the index) of this element */
    oTable1.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 = "";
    this.background = "";
    }
    } );

    $("tfoot input").blur( function (i) {
    if ( this.value == "" )
    { this.className = "search_init";
    this.value = asInitVals[$("tfoot input").index(this)];
    }
    } );
    } );
    [/code]

    Do you know how?
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    http://live.datatables.net/oxusos/edit#javascript,live

    (bit quick 'n dirty)
  • fernandonaimfernandonaim Posts: 9Questions: 0Answers: 0
    it searches the two simultaneously.
    Know how to do research separately?
  • CatyNetCatyNet Posts: 3Questions: 0Answers: 0
    You need to download "JQuery-DataTables-ColumnFilter.zip".
    https://code.google.com/p/jquery-datatables-column-filter/ .

    [code]
    ('#example').dataTable({
    // Your params
    }).columnFilter({
    aoColumns: [ { type: "text"},
    { type: "text"} ] })
    [/code]
  • rupakdas85rupakdas85 Posts: 3Questions: 0Answers: 0
    Please Help!
    I am using editable API.How to add multiple input types on same table.
    In jquery.jeditable.js library we can only provide one input type.

    $.fn.editable.defaults = {
    name : 'value',
    id : 'id',
    type : 'text',
    width : 'auto',
    height : 'auto',
    event : 'click.editable',
    onblur : 'submit',
    loadtype : 'GET',
    loadtext : 'Loading...',
    placeholder: 'N/A',
    loaddata : {},
    submitdata : {},
    ajaxoptions: {}
    };
    In the above type is text only.what to do if i want drop down for a column.

    Thanks in Adv.
This discussion has been closed.