农业网格 Angular "colDef.cellRendererFramework.component is deprecated"
ag-grid Angular "colDef.cellRendererFramework.component is deprecated"
从以前版本的 ag-grid 开始,我们可以像这样将组件作为依赖项传递到我们的 cellRendererFramework 中:
{
headerName: "Clickable Component",
field: "name",
cellRendererFramework: {
component: ClickableParentComponent,
dependencies: [ClickableComponent]
},
width: 200
}
这是取自 ag-grid blog 的示例。
不幸的是版本 9 给了我一个弃用的警告:
colDef.cellRendererFramework.component is deprecated - please refer to https://ag-grid.com/best-angular-2-data-grid/
现在有什么推荐的方法可以实现吗?我在 ag-grid 的更新日志中找不到任何相关信息。
您是否错过了博客的这一部分?
instead of:
{
headerName: "Clickable Component",
field: "name",
cellRendererFramework: {
component: ClickableParentComponent,
dependencies: [ClickableComponent]
},
width: 200
}
You now only need to do this:
{
headerName: "Clickable Component",
field: "name",
cellRendererFramework: ClickableParentComponent,
width: 250
}
对,与父组件通信的技巧是使用上下文对象:
this.gridOptions = <GridOptions>{
context: {
componentParent: this
}
};
从以前版本的 ag-grid 开始,我们可以像这样将组件作为依赖项传递到我们的 cellRendererFramework 中:
{
headerName: "Clickable Component",
field: "name",
cellRendererFramework: {
component: ClickableParentComponent,
dependencies: [ClickableComponent]
},
width: 200
}
这是取自 ag-grid blog 的示例。
不幸的是版本 9 给了我一个弃用的警告:
colDef.cellRendererFramework.component is deprecated - please refer to https://ag-grid.com/best-angular-2-data-grid/
现在有什么推荐的方法可以实现吗?我在 ag-grid 的更新日志中找不到任何相关信息。
您是否错过了博客的这一部分?
instead of:
{ headerName: "Clickable Component", field: "name", cellRendererFramework: { component: ClickableParentComponent, dependencies: [ClickableComponent] }, width: 200 }
You now only need to do this:
{ headerName: "Clickable Component", field: "name", cellRendererFramework: ClickableParentComponent, width: 250 }
对,与父组件通信的技巧是使用上下文对象:
this.gridOptions = <GridOptions>{
context: {
componentParent: this
}
};