I am using the “hiddenColumns” plugin to hide or show a column according to a button click as such:
button.onclick = function() {
const plugin = hot.getPlugin('hiddenColumns');
if (plugin.isHidden(0, true))
plugin.showColumn(0);
else
plugin.hideColumn(0);
hot.render();
}
Also, I have hiddenColumns: { columns: [0] }
in the options object to start the column hidden.
The problem is that when I use hot.updateSettings({});
anywhere, even with unrelated settings, the table gets rendered again, resetting the column’s state to hidden when it should be shown. It also works the other way around: if I set it initially to shown, and hide it using my button that calls the plugin and then call updateSettings()
, it will show again.
What can I do?