Setting the “visible” property on a GridColumn to false correctly hides the column, but setting it back to true doesn’t seem to make the column visible. In the following snippet clicking anywhere on the grid’s header should toggle the visibility state of the first column, but it only works one way. Calling the grid’s runPostponedComputations() method doesn’t help either.
let nRowCount = 1000;
let nColCount = 100;
let grid = grok.shell.addTableView(grok.data.demo.randomWalk(nRowCount, nColCount)).grid;
rxjs.fromEvent( grid.overlay, 'click').subscribe((e) => {
let nButton = e.button;
if (nButton === 0)
{
let cell = grid.hitTest(e.offsetX, e.offsetY);
if (cell.isColHeader) {
let colFirst = grid.columns.byIndex(1);
colFirst.visible = !colFirst.visible;
}
}
});