When a click is made on the top left cell (located at the intersection of row and column headers) of a Grid viewer, the cell object returned as a result of the mouse hit test method has isRowHeader and isColHeader properties both set to false. Logically they both should be true. And while this can be debatable, accessing the idx property for the corresponding grid column shouldn’t throw exception. Please see the snippet below.
let grid = grok.shell.addTableView(grok.data.demo.randomWalk(100, 100)).grid;
rxjs.fromEvent( grid.overlay, ‘click’).subscribe((e) => {
let nButton = e.button;
if (nButton === 0)
{
let cell = grid.hitTest(e.offsetX, e.offsetY);
let bRH = cell.isRowHeader; //logically should return true, but returns false
let bCH = cell.isColHeader; //logically should return true, but returns false
let colGrid = cell.gridColumn;
let nIdx = 0;
try {nIdx = colGrid.idx;}
catch (e) {
let strErr = e.message; //shouldn't happen in any case
}
}
});