我正在用 ag-grid 编写一个有角度的项目,我想尝试一下行分组。下面是来自ag-grid网站的测试代码。然而,网格显示常规网格并在调试窗口中接收以下内容。
ag-Grid:enableRowGroup仅在ag-Grid-Enterprise中有效,你的列定义不应该有enableRowGroup
知道如何使用 ag-grid-enterprise 试用版吗?
要使用ag-grid-enterprise功能,首先您需要安装以下npm包:
npm install --save ag-grid-enterprise
然后,将导入添加到app.module.ts:
import 'ag-grid-enterprise';
如果一切正常,您应该在控制台中看到一条消息,告诉您没有企业许可证密钥。
这些步骤对我有用。
// Add this to your component.ts
Step 1: import { AllModules, Module } from '@ag-grid-enterprise/all-modules';
// Add this to your component.ts
Step 2: modules: Module[] = AllModules;
// Add this to your component.html
Step 3: <ag-grid-angular [modules]=modules ....></ag-grid-angular>
在 app.modules.ts 中添加以下内容可以解决问题 从'@ag-grid-community/angular'导入{AgGridModule};