title: Button Hiding in Datatables
body: <p>I want to hide groups of columns or select the ones to show or hide using buttons in my datatable. This is my javascript code:</p>
  
  <pre><code>$('#doentes').DataTable({
       "ajax" :  "phpcode.php",
  
       "columns" : [ 
       {
        "data" : "item1"
   }, {
        "data" : "item2"
   }, {
        "data" : "item3" 
   }, {
        "data" : "item4"
   }, {
        "data" : "item5"   
   }],
  
   "scrollX": true,
  
   "orderFixed": [[ 1, "asc"],[ 2, "asc"],[ 3, "asc"]]
  
  }); 
  </code></pre>
  
  <p>I can't get the hiding buttons to work, i've tried some examples without success, like:</p>
  
  <pre><code>dom: 'Bfrtip',
          buttons: [
              'colvis'
          ]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>dom: 'Bfrtip',
          buttons: [
              {
                  extend: 'colvisGroup',
                  text: 'Group 1',
                  show: [ 1, 2 ],
                  hide: [ 3, 4 ]
              },
              {
                  extend: 'colvisGroup',
                  text: 'Group 2',
                  show: [ 3, 4 ],
                  hide: [ 1, 2 ]
              },
              {
                  extend: 'colvisGroup',
                  text: 'Group 3',
                  show: ':hidden'
              }
          ]
  </code></pre>
  
  <p>How can I apply this to my code?</p>
  
  <p>Edit:
  my includes:</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css"&gt;  
            &lt;script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"&gt;&lt;/script&gt;
            &lt;script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap4.min.js"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>No error appear on the console when i try those options, the only difference is that the dropdown with the option to show 10, 25,50 and 100 rows per page dissapear.</p>