gpt4 book ai didi

angular - onCellClicked 只有第一个 Cell AgGrid

转载 作者:行者123 更新时间:2023-12-02 17:08:36 27 4
gpt4 key购买 nike

我只想获取第一列的数据,或者我知道索引该列,AgGrid Angular2。

我在用

cellClicked

html

(cellClicked)="onCellClicked(event)" 

组件.ts

onCellClicked(event) {
console.log('(event', event);
}

问题是我可以在所有行中“点击”...但我只想点击第一列或使用 if() 知道 indexCell,如果它是 cell == 0 ...

最佳答案

onCellClicked(event){
if (event.column.getColId() === 'your first column id') {
// do your stuff here
}
}

关于angular - onCellClicked 只有第一个 Cell AgGrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50490171/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com