1

我有一个带有 rowpan 的 flextable。在表的单击事件上,我试图获取表的行索引和列索引。

如果该行没有行跨度,则没有问题,但是当该行有任何行跨度时,我得到的 col 索引应该更少。我得到这个:

idx : the index i am geting
sCnt: span count at that row
clIdx: column index that i click

idx = clIdx - sCnt;

我正在使用这段代码:

int row = flexTable.getCellForEvent(event).getRowIndex();
int col = flexTable.getCellForEvent(event).getCellIndex();
4

1 回答 1

0

Well I could not find the solution but I've done somethi,ng I didn't like. I've written a new widget extending focuspanel and it keeps column and row indexes. These indexes are set in the constructor and I access indexes via my widget's click event.

于 2013-03-21T12:26:34.127 回答