我正在寻找一种方法来查看哪个列发生了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);
}
});事先谢谢,我似乎找不到这可能的地方
发布于 2018-11-07 03:33:29
不幸的是,没有现成的方法来实现这样的功能,所以它需要一些技巧。这个想法很简单--如果dataGrid列的宽度是预先定义的,我们可以比较单击X坐标和列宽度。有关详细信息,请通过下面的注释中提供的链接查看示例。
https://stackoverflow.com/questions/53156831
复制相似问题