【问题标题】:Can't bind to 'groupDisplayType' since it isn't a known property of 'ag-grid-angular'无法绑定到“groupDisplayType”,因为它不是“ag-grid-angular”的已知属性
【发布时间】:2022-01-27 19:53:05
【问题描述】:

我正在尝试绑定 groupDisplayType 属性,但看起来该属性已在最新版本的 Ag-Grid 中被删除。我正在使用 25.1.0。

<ag-grid-angular
    [columnDefs]="columnDefs"
    [groupDisplayType]="groupDisplayType"
    /* other grid options ... */>
</ag-grid-angular>

错误:

NG8002: Can't bind to 'groupDisplayType' since it isn't a known property of 'ag-grid-angular'.
1. If 'ag-grid-angular' is an Angular component and it has 'groupDisplayType' input, then verify that it is part of this module.
2. If 'ag-grid-angular' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

6     [groupDisplayType]="groupDisplayType"

Ag-grid 网站上有一些在线示例,但它们似乎使用的是旧版本的 ag-grid。

有没有其他方法可以绑定groupDisplayType

【问题讨论】:

  • 文档仍然说它是网格的有效属性。您的模块是否正确导入 AgGridModule?
  • 是的,我再次验证了。它已按照ag-grid.com/angular-data-grid/getting-started 实施。我也可以使用所有其他 ag-grid 企业版属性。

标签: angular ag-grid ag-grid-angular


【解决方案1】:

groupDisplayType 的概念仅在 26.0.0 版本中引入 Ag Grid。

您需要升级到 26+ 才能使用它。使用旧版本的 Ag Grid 时,请始终使用与您的版本相关的文档,在这种情况下:https://www.ag-grid.com/archive/25.1.0/angular-grid/

【讨论】:

    猜你喜欢
    • 2017-10-29
    • 2020-09-24
    • 2021-06-25
    • 2018-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-04
    • 2020-09-10
    相关资源
    最近更新 更多