cellClicked don't call function AgGrid Angular 2

柔情痞子 提交于 2019-12-11 14:54:59

问题


I want do "click" in my cell and show console.log, but this function doesn't run:

  headerName: 'Id',
  field: 'id',
  cellClicked: function() {
          console.log('asssaasas');
  }

I did click in my cell the AgGRID but in html5.console I don't show nothing....


回答1:


Seems like you are adding cellClicked event at column level - within ColDef.

It doesn't work that way. It's a grid level event.

<ag-grid-angular #agGrid class="ag-fresh"
   ..... 
    (cellClicked)="onCellClicked($event)"
   ....
 >
</ag-grid-angular>

And within your component, write the function to handle this.

onCellClicked($event: CellClickedEvent) {
    console.log('asssaasas');
}


来源:https://stackoverflow.com/questions/50487719/cellclicked-dont-call-function-aggrid-angular-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!