onCellClicked只有第一个Cell AgGrid

时间:2018-05-23 13:51:23

标签: angular ag-grid

我想获取数据只是第一列,或者我知道索引列Aggrid Angular2。

我正在使用

cellClicked

HTML

(cellClicked)="onCellClicked(event)" 

component.ts

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

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

1 个答案:

答案 0 :(得分:0)

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