column visible in DatabTable not working

column visible in DatabTable not working

rahulcapgemirahulcapgemi Posts: 8Questions: 3Answers: 0

Hello All

I am replacing fnSetColumnVis method from column.visible method . But its throwing an error ,its not a function

var oTable = $("#hfLibTable").dataTable();
//oTable.fnSetColumnVis( 6, false );
oTable.column( 6 ).visible(false);

Please advise

Replies

  • kthorngrenkthorngren Posts: 21,117Questions: 26Answers: 4,916
    edited May 2018

    Please see this FAQ.

    Kevin

  • rahulcapgemirahulcapgemi Posts: 8Questions: 3Answers: 0

    is their any mistake . Please guide I am new in DataTable code

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @rahulcapgemi ,

    Kevin pointed you to the answer in his link. The problem is because you're getting a jQuery handle with this:

    var oTable = $("#hfLibTable").dataTable();
    

    Change that to this:

    var oTable = $("#hfLibTable").DataTable();
    

    And all will be ok,

    Cheers,

    Colin

This discussion has been closed.