Multi Filter and ColVis problem after showing hidden columns

Multi Filter and ColVis problem after showing hidden columns

NeroburNerobur Posts: 3Questions: 0Answers: 0
edited August 2013 in General
Hello,

i have some problmes with multi filter and ColVis after showing hidden columns.

The table are going well, when colvis are not hiding columns, but when i set

oTable.fnSetColumnVis( 5, false );

after showing this colum the search function in the footer are not going

i think that colvis dont load the hidden columns, and then when i will show this column i cant search in them.

Please help me

Thanks alot.

Replies

  • cdonatecdonate Posts: 9Questions: 0Answers: 0
    Can you post some of your code?
  • NeroburNerobur Posts: 3Questions: 0Answers: 0
    [code]









    var asInitVals = new Array();

    $(document).ready(function() {
    var oTable;

    /* Add the events etc before DataTables hides a column */
    $("thead input").keyup( function () {
    /* Filter on the column (the index) of this element */
    oTable.fnFilter( this.value, oTable.oApi._fnVisibleToColumnIndex(
    oTable.fnSettings(), $("thead input").index(this) ) );
    } );

    /*
    * Support functions to provide a little bit of 'user friendlyness' to the textboxes
    */
    $("thead input").each( function (i) {
    this.initVal = this.value;
    } );

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

    $("thead input").blur( function (i) {
    if ( this.value == "" )
    {
    this.className = "search_init";
    this.value = this.initVal;
    }
    } );




    var oTable = $('#example').dataTable( {
    "sDom": 'RC<"clear"><"H"lfr>t<"F"ip>',
    "bJQueryUI": true,
    "oLanguage": {
    "sSearch": "Search all columns:"
    },
    "bSortCellsTop": true
    } );
    oTable.fnSetColumnVis( 5, false );
    oTable.fnSetColumnVis( 6, false );
    oTable.fnSetColumnVis( 7, false );
    oTable.fnSetColumnVis( 8, false );
    oTable.fnSetColumnVis( 13, false );
    oTable.fnSetColumnVis( 14, false );
    oTable.fnSetColumnVis( 15, false );
    oTable.fnSetColumnVis( 16, false );
    oTable.fnSetColumnVis( 17, false );
    oTable.fnSetColumnVis( 18, false );
    oTable.fnSetColumnVis( 19, false );
    oTable.fnSetColumnVis( 20, false );
    oTable.fnSetColumnVis( 21, false );
    oTable.fnSetColumnVis( 22, false );




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



    /*
    * 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)];
    }
    } );
    } );
    [/code]
  • cdonatecdonate Posts: 9Questions: 0Answers: 0
    Try changing

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

    for

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

    I'm not sure what is the problem. If you could elaborate, it would be helpful.
  • NeroburNerobur Posts: 3Questions: 0Answers: 0
    not working

    http://tinypic.com/view.php?pic=2h72g09&s=5

    here u can see that recovery column is set visible and the filter is going right
    and defense are a hidden column and the filter is not going
This discussion has been closed.