EduBw
EduBw

Reputation: 942

onCellClicked only first Cell AgGrid

I want get datas only the first column, or I know index the column,AgGrid Angular2.

I'm using

cellClicked

html

(cellClicked)="onCellClicked(event)" 

component.ts

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

The problem is that I can "click" in all rows... But I want can only do click in the first column or with if() know indexCell and if It is cell == 0 ...

Upvotes: 2

Views: 8823

Answers (1)

Jeff Tian
Jeff Tian

Reputation: 5893

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

Upvotes: 6

Related Questions