HiddenColumns not working for me

Tags: #<Tag:0x00007f8b25b20978>

I’m trying to hide columns but it’s not working for me. I’m new to Handson table so I’m probably messing something up. I’m using HT 6.2.2 CE edition with the non-commercial license. The following code is not hiding columns:

var hot = new Handsontable(container, {
$script = $script . ’ data: data,’;
$script = $script . ‘startCols: 8,’;
contextMenu: true,
dropdownMenu: true,
‘hiddenColumns: {
copyPasteEnabled: true,
indicators: true,
columns: [0, 1, 7]’
},
licenseKey: ‘non-commercial-and-evaluation’
});

I’m using straight javascript. Any help is much appreciated, Thanks!

Hey @awf

those settings are completely fine (demo https://jsfiddle.net/zqm104xe/) you just need to remove the ' (string notation) from the hiddenColumns configuration.

Hey, Thanks for the quick reply! I’m actually using PHP to build the javascript.
I made a mistake converting my PHP code so you could see the javascript that gets built. The resulting javascript doesn’t actually have the single ticks around the hiddenColumns config.

v/r,
awf

Does it mean that now it works for you or ou still can’t hide the columns?

Sorry, I should have been more specific. I believe my javascript matches the demo code you referenced in your first reply, however it’s still not working.

Here is the full HTML source. It’s just a small test page so I can learn Handsontable:

            <link href="./htable/dist/handsontable.full.min.css" rel="stylesheet" media="screen"> 
	<link rel=stylesheet href=style.php type="text/css">

            <script src="./htable/dist/handsontable.full.min.js"></script> 


            <script>function drawGrid(){var data = [{"s_id":"370","l_id":"1","gdate":"05.06.2018","gtime":"18:00:00","gfield":"1","t_hid":"10","t_aid":"16","isModified":"0"},{"s_id":"371","l_id":"1","gdate":"05.06.2018","gtime":"19:00:00","gfield":"1","t_hid":"17","t_aid":"15","isModified":"0"}];var container = document.getElementById("GridBag"); var hot = new Handsontable(container, {  data: data,startCols: 8,  colHeaders: ["s_id","l_id","Date", "Time", "Field", "Team 1","Team 2","is_modified"],contextMenu: true,dropdownMenu: true,hiddenColumns: true,hiddenColumns: {copyPasteEnabled: true,indicators: true,columns: [0, 1, 7]},  licenseKey: 'non-commercial-and-evaluation'});}  window.onload=drawGrid;</script>
</head>
<body>
  <div class=upperDiv id=upperDiv>
    <b>Test Page</b>
  </div>

      <div id="GridBag"></div>

</body>

Hey @awf

please download this .html https://we.tl/t-br1MVFH4UX and let me know how it works for you.

I get this

which is, as I believe, the correct construction.

Hey,

I figured out my error from your example. I made a mistake with the link tag that references the handsontable css file.

Great support!

Thank you!

I’m glad that you’ve found the solution. Thank you for an update.