【问题标题】:agGrid rollup example shows missing ClientSideRowModelModuleagGrid 汇总示例显示缺少 ClientSideRowModelModule
【发布时间】:2020-03-09 17:52:33
【问题描述】:

我尝试执行 ag-grid 在其页面上显示的最小汇总示例。但无论如何,我不会让它工作。我得到的错误是:

ag-Grid: could not find matching row model for rowModelType clientSide
Row Model "Client Side" not found. Please ensure the ClientSideRowModelModule is loaded using: import '@ag-grid-community/client-side-row-model';

我尝试导入 ClientSideRowModelModuleClientSideRowModel,如错误中所述,但这没有任何改变。

我尝试并逐步浏览了捆绑的代码,似乎 agggrid 无法访问他们自己的模块,尽管它们存在。

我把例子上传到了github,直接克隆npm i && npm run rullup然后打开index.html文件。 https://github.com/dennis-f/ag-grid-clientsiderowmodel-bug

git clone git@github.com:dennis-f/ag-grid-clientsiderowmodel-bug.git
npm i && npm run rollup

【问题讨论】:

    标签: javascript ag-grid rollup


    【解决方案1】:

    好的,我设法让它工作。

    旧:

    import {Grid} from '@ag-grid-community/all-modules';
    

    新:

    import {AllCommunityModules, Grid, ModuleRegistry} from '@ag-grid-community/all-modules';
    ModuleRegistry.registerModules(AllCommunityModules);
    

    我不知道为什么所有这些示例都缺少此功能,但您需要手动注册模块,即使您使用“all-modules”包。

    不知道所有模块都应该在启动时加载。这是一个很好的解决方案,但不幸的是它只解释了here

    显然你可以只加载你真正需要的而不是AllCommunityModules

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-10
      • 2016-06-22
      相关资源
      最近更新 更多