PLEASE HELP! Why is ColVis button disappearing when I add tabletools button?

PLEASE HELP! Why is ColVis button disappearing when I add tabletools button?

DenonthDenonth Posts: 76Questions: 0Answers: 0
edited July 2012 in General
Hi all I am wondering how can I have ColVis option and TableTools buttons defined on the same table?

This is my code
[code]

$('#jphit').dataTable( {
"sDom": 'C<"clear">lfrtip',
"sDom": 'T<"clear">lfrtip',
"oColVis": {
"buttonText": "Extend table",
"activate": "mouseover"
},
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 0 ] }
],
"bProcessing": true,
"bServerSide": true,
"sScrollY": "350px",
"bDeferRender": true,
"sAjaxSource": "increment_table.php"
} );

[/code]

Replies

  • DenonthDenonth Posts: 76Questions: 0Answers: 0
    Guys give me some idea of how to achieve this. I need to have a ColVis button and TableTools buttons on the same table
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    You are declaring the sDom property twice.

    If I gave you the Javascript object:

    [code]
    {
    "a": 1,
    "a": 2
    }
    [/code]

    and then ask what the value of the property "a" is - what is it - 1 or 2? :-)

    The letters in the sDom string a features (see the documentation for sDom for the defaults). The plug-ins add extra letters to the options -'C' for ColVis, 'T' for TableTools - so just include them both.

    Allan
  • DenonthDenonth Posts: 76Questions: 0Answers: 0
    Thank you
This discussion has been closed.