eutychos tfar
eutychos tfar

Reputation: 179

How to install ag-Grid enterprise properly?

i have tested some components with ag-Grid community edition but it has limited supportability, such as to add set filters using SetFilterModule, so the filter boxes would appear under the column header name, cannot be done with community version, therefore i have uninstalled the community version and installed the enterprise version using npm command

npm i ag-grid-enterprise 

after installing package.json shows dependencies and node_modules folder shows Enterprise modules.

But when i tried to import AgGridModule from the import statement in the app.module.ts it did not show AgGridModule on the drop down. As shown on the image below, it had only three options LicenseManager, SetFilter, VirtualList. so, It had given me the impression that it required a license. But according to agGrid website i can use the full enterprise version of the grid without a license and the only barriers it will add are water marks and the console error message.

https://www.ag-grid.com/license-pricing.php

But in order to at least see those console messages i have to install it properly. So i believe that i have not installed the agGrid properly yet.

Therefore can anyone provide me on the steps on how to install the agGrid enterprise version and run it without a license key ( with watermark and console error messages )?

enter image description here

Upvotes: 2

Views: 21339

Answers (3)

Ben in CA
Ben in CA

Reputation: 851

After messing around with trying to get Enterprise installed correctly, I finally found that I could do this:

import {LicenseManager} from "ag-grid-enterprise";
LicenseManager.setLicenseKey("KEY HERE");

(Without the @ and no /core)

And that solved my issues.

Upvotes: 1

reads0520
reads0520

Reputation: 716

With almost no help from the AG Grid documentation, I finally ran across this for the module method of installation with Angular.

npm install @ag-grid-enterprise/all-modules
npm install @ag-grid-community/angular

(If you want to install only certain modules, instead of all-modules, install only the ones you want.)

If moving from the community package install, be sure to uninstall packages ag-grid-community and ag-grid-angular, and replace all of your imports to use the new modules instead of the old packages.

For styles in your styles.scss:

@import "../node_modules/@ag-grid-community/core/dist/styles/ag-grid.css";
@import "../node_modules/@ag-grid-community/core/dist/styles/ag-theme-<whatever-theme-you-want>.css";

Edit:

I did finally find reference to @ag-grid-community/angular in their docs, Modules Overview page, which also outlines all of the modules to install for specific features, both community and enterprise, instead of installing @ag-grid-enterprise/all-modules: https://www.ag-grid.com/angular-data-grid/modules/

Upvotes: 1

Shuheb
Shuheb

Reputation: 2352

To add ag-grid-enterprise to your application, you must also have ag-grid-community also installed. The reason for this can be found here in the documentation.

Since you are using Angular, you also need to add the framework support by adding ag-grid-angular to your app. In your modules file you must import the AgGridModule from ag-grid-angular:

import { AgGridModule } from 'ag-grid-angular';

Once these 3 packages are installed, you can enable enterprise features in your app by adding the following line to your component file:

import "ag-grid-enterprise";

You can find documentation for all of this in the ag-grid angular getting started guide.

I've created a stackblitz example which has ag-grid-enterprise working on Angular.

Upvotes: 1

Related Questions