检查在 rowClick 事件中单击了哪一列

Check which column has been clicked on rowClick event

我正在寻找一种方法来查看发生了 rowClick 事件的列。 因为基于这发生在哪一列,我们希望其他事情发生。 我们已经有了这样的东西:

this.chart.listen('rowClick', (event) => {
  if (event['period'] && event['period'].itemType === GanttItemType.work) {

    setTimeout(() => this.clickedDetail(event), 1);
  } else if (event['item'] && event['item'].get('technicianId') && !event['period']) {
   // HERE WE WANT TO KNOW IN WHICH COLUMN WE ARE
    const technicianId = event['item'].get('technicianId');
    setTimeout(() => this.openTechnician(technicianId), 1);
  } else {
   this.preventDef(event);
  }
});

提前致谢我似乎找不到if/where这是可能的

遗憾的是,没有开箱即用的方法来实现此类功能,因此需要一些技巧。 这个想法很简单——如果预定义了 dataGrid 列宽,我们可以比较点击 X 坐标和列宽。有关详细信息,请通过下面评论中提供的link检查示例。