【问题标题】:Migrating from ag-grid-community to ag-grid-enterprise with Angular使用 Angular 从 ag-grid-community 迁移到 ag-grid-enterprise
【发布时间】:2020-03-07 15:32:53
【问题描述】:

我已经在开发中成功使用了 ag-grid-community。现在我想搬到 ag-grid-enterprise。我有我的执照。我遵循 Ag-Grid 文档中相当模糊的说明。但是文档不起作用。

文档说我应该初始化企业网格的属性 [模块]。但是没有这样的属性!并且不知道要不要在安装过程中把社区版的包去掉。有人经历过这种迁移吗?

【问题讨论】:

  • 你有代码吗?你有错误吗?您是否联系过他们的产品支持?
  • 我陷入了 ag-Grid 发布 22.0.0 的过渡期。请参阅下面我稍后的评论。我现在可以完美地在企业上运行。

标签: angular ag-grid


【解决方案1】:

不,您不应该删除社区包。企业库是社区库的补充,而不是替代社区库。

AFAIK,您需要做的就是:

  • 安装 ag-grid-enterprise 软件包 (npm install)
  • 在 main.ts 中添加您的许可证,例如

    import {LicenseManager} from 'ag-grid-enterprise';
    
    LicenseManager.setLicenseKey(
      'your-license-key'
    );
    
  • 在您要使用网格的任何模块中,导入所需的 ag-grid 模块,例如

    import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { AgGridModule } from 'ag-grid-angular';
    
    @NgModule({
      'imports': [
        CommonModule,
        AgGridModule.withComponents([])
      ]
    })
    export class MyModule {
    }
    

【讨论】:

  • 截至 2019 年 11 月 11 日星期一早上,随着 22.0.0 的发布,模块结构发生了显着变化。您不再需要社区模块。企业包现在包含除了框架模块之外的所有内容。见ag-grid.com/javascript-grid-modules
猜你喜欢
  • 2020-08-19
  • 2020-04-06
  • 2020-03-31
  • 2021-09-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-07-16
  • 2023-01-20
相关资源
最近更新 更多