【发布时间】:2018-05-20 12:48:15
【问题描述】:
我正在尝试通过双击一行从 ag-grid 中恢复客户端。 我正在使用 angular 5 和 ag-grid。
ag-grid 是一个名为 grid_client 的组件中的子组件,当我双击给定行时,我已将其注入名为quotation-creation 的父组件中,我可以控制子组件中单击的行,但在父组件中,什么都没有出现!这是我的代码: 子级:客户端网格组件
@Output() clientRow : EventEmitter<any> = new EventEmitter();
createGridOptions() {
this.gridOptions = <GridOptions>{};
this.gridOptions.onRowDoubleClicked = this.clientAdd;
}
clientAdd=(row)=>{
this.clientRow.emit(row.data);
console.log(row.data)// i could be sure that the row is displayed in the console
}
之后我在 Parent 中调用了我的活动:
<h3>List of client</h3>
<app-grid-client (clientRow)='rowClient($event) >//to display the grid and recuperate the event
</app-grid-client>
在父组件的ts中
rowClient( row ) {
console.log(row);
}
父组件中没有出现任何错误或未定义。
能否请您帮忙知道为什么我没有在父级中点击该行?
【问题讨论】:
-
如果答案对您有帮助,请告诉我