【发布时间】:2019-10-09 11:41:08
【问题描述】:
每当用户单击特定单元格中的文本时(在本例中为“名称”列),我都会尝试打开一个组件。我遇到的问题是 Ag-Grid 中没有任何方法(据我所知)允许这样做。我相信有一种方法可以为特定单元格添加点击事件,但我试图让它只捕获点击单元格文本时的事件。有谁知道我如何做到这一点?
我尝试了很多 Ag-Grid 方法,但没有一个有单元格文本点击事件。
this.gridOptions.api.setColumnDefs([{
headerName: "Name",
field: "Name"
},
{
headerName: "Description",
field: "Description"
},
{
headerName: "Actions",
cellRendererFramework: ActionsRoleComponent,
autoHeight: false,
cellClass: 'actions-button-cell d-flex align-items-center justify-content-center',
width: 80,
pinned: 'right',
suppressResize: true,
suppressFilter: true,
suppressSorting: true,
suppressMovable: true,
cellEditorFramework: ActionsRoleComponent
}
]);
this.gridOptions.api.setRowData(receivedJson);
this.gridOptions.api.sizeColumnsToFit();
【问题讨论】:
-
点击事件是否适用于名称列中的所有单元格?
标签: angular typescript ag-grid