Polymer 2.0 vaadin-grid 3.0.2 CellClickBehavior problem finding cell index

Hello,

I have recently been migrating from Polymer 1.7 to Polymer 2.0 and have found that a procedure for obtaining the column index of a clicked cell in vaadin-grid no longer works. I am mixing into the component vaadin.elements.grid.CellClickBehavior.

Adding this listener in the ready() function:

this.$.restores.addEventListener(‘cell-focus’, (e) => { e.stopPropagation(); this.clickedCell = e.target; });

and then accessing that property when the active element changes (after checking that this.clickedCell is defined):

if (this.clickedCell.cellIndex == 2) { … }

no longer works because cellIndex is undefined.

Do you have any suggestion as to what to do to achieve this now?

I have attached the full code of the component in question.

Thanks, Al
39401.html (14.9 KB)

In fact, it looks like the target is vaadin-grid.

So taking into consideration retargeting using composedPath, setting this.clickedCell to e.composedPath()[0]

gives the vaadin-grid-table-cell.

But the index property there is not what I’m looking for (it’s the row number).

Accessing column just gives the vaadin-grid-column component.

Is there some other means by which I can identify the column of the cell which was clicked?

i don’t know whether this is hacky or not, but the first digit of order (since these columns are not reorderable) seems to to it for me.