Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Tenable updates Vulnerability Priority Rating scoring method to flag fewer vulnerabilities as critical

      July 24, 2025

      Google adds updated workspace templates in Firebase Studio that leverage new Agent mode

      July 24, 2025

      AI and its impact on the developer experience, or ‘where is the joy?’

      July 23, 2025

      Google launches OSS Rebuild tool to improve trust in open source packages

      July 23, 2025

      EcoFlow’s new portable battery stations are lighter and more powerful (DC plug included)

      July 24, 2025

      7 ways Linux can save you money

      July 24, 2025

      My favorite Kindle tablet just got a kids model, and it makes so much sense

      July 24, 2025

      You can turn your Google Photos into video clips now – here’s how

      July 24, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Blade Service Injection: Direct Service Access in Laravel Templates

      July 24, 2025
      Recent

      Blade Service Injection: Direct Service Access in Laravel Templates

      July 24, 2025

      This Week in Laravel: NativePHP Mobile and AI Guidelines from Spatie

      July 24, 2025

      Retrieve the Currently Executing Closure in PHP 8.5

      July 24, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      FOSS Weekly #25.30: AUR Poisoned, Linux Rising, PPA Explained, New Open Source Grammar Checker and More

      July 24, 2025
      Recent

      FOSS Weekly #25.30: AUR Poisoned, Linux Rising, PPA Explained, New Open Source Grammar Checker and More

      July 24, 2025

      How to Open Control Panel in Windows 11

      July 24, 2025

      How to Shut Down Windows 11

      July 24, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Unboxing AG-Grid: A Quick Start Guide for Angular Developers

    Unboxing AG-Grid: A Quick Start Guide for Angular Developers

    July 23, 2025

    What is a Grid and Why Ag-Grid?

    A grid is one of the best methods to present data in a structured and understandable way. At a glance, grids help extract concise information efficiently. When working with complex data tables in Angular applications, AG Grid Angular is an excellent choice for developers.AG-Grid is a popular package that simplifies grid implementation while offering extended functionalities such as sorting, filtering, editing, pagination, custom themes, and much more. 

    The enterprise version even includes advanced features like charts, Excel exporting, and row grouping, making it a robust solution for enterprise-grade applications. 

    Community vs Enterprise 

    Community is the free version of ag-grid which has ag-grid-community package.  

    • Basic grid including sorting, filtering, and pagination 
    • Inbuilt themes and custom styling 
    • Custom cell rendering 

    Enterprise consists of a paid version of ag-grid which has ag-grid-enterprise package. 

    • Supports server-side rendering (SSR) 
    • Advanced features such as Excel export, enhanced security, and more 
    • Requires a valid license key 

    Installation in ag grid angular 

    1. Install the ag-grid-angular package from npm
      This installs the community version (free version)
      npm install ag-grid-angular
    2. Install the ag-grid-enterprise package from npm
      This installs the enterprise version (paid version)
      npm install ag-grid-enterprise

       

    Registering  Modules 

    AG-Grid uses modular architecture. To use the community features, import and register the community modules like this: 

    import { AllCommunityModule, ModuleRegistry } from 'ag-grid-community'; 
    
    // Register all community modules  
    ModuleRegistry.registerModules([AllCommunityModule])

    For enterprise features, you first need to register the enterprise modules.For enterprise features, you need to first register the enterprise modules. In addition, you must set your license key to activate these features properly. Moreover, it is essential to ensure both steps are completed to achieve full functionality. Therefore, following these steps carefully will help avoid any issues.

    import { LicenseManager } from 'ag-grid-enterprise';  
    import { AllEnterpriseModule } from 'ag-grid-enterprise';  
    
    //add license key
    LicenseManager.setLicenseKey('your-ag-grid-license-key');  
    
    // Register all enterprise modules  
    ModuleRegistry.registerModules([AllEnterpriseModule]);

    Note: Register the modules in the main.ts  file (the file where bootstrap is defined). 

    Creating Basic Grid 

    In your app.module.ts file, import AgGridModule from the @ag-grid-community/angular package. This module enables the use of AG Grid components in your Angular application. Once imported, you can easily configure and use AG Grid features throughout your app module.

    import { NgModule } from '@angular/core';  
    import { BrowserModule } from '@angular/platform-browser';  
    import { AppComponent } from './app.component';  
    import { AgGridModule } from '@ag-grid-community/angular';  
    
    @NgModule({  
      imports: [  
        BrowserModule,  
        AgGridModule,  
      ],  
      declarations: [AppComponent],  
      bootstrap: [AppComponent],  
    })  
    
    export class AppModule {}

    In app.component.html, add ag-grid-angular tag with required parameters 

    <ag-grid-angular 
      #agGrid 
      class="ag-theme-balham"
      style="width: 615px; height: 165px;" 
      [rowData]="rowData" 
      [columnDefs]="columnDefs"
    ></ag-grid-angular>

    In app.component.ts file, define the parameters for ag grid 

    import { Component } from '@angular/core'; 
    import { AgGridAngular } from '@ag-grid-community/angular'; 
    
    @Component({ 
      selector: 'my-app', 
      templateUrl: './app.component.html', 
      styleUrls: ['./app.component.css'], 
    }) 
    
    export class AppComponent { 
      columnDefs = [ 
        { 
          headerName: 'Employee ID', 
          field: 'emp_id', 
          sortable: true, 
          filter: true, 
        }, 
        { 
          headerName: 'Designation', 
          field: 'designation', 
        }, 
        { 
          headerName: 'Joining Year', 
          field: 'joining_year', 
        }, 
      ]; 
     
      rowData = [ 
          { 
            emp_id: 'EMP01', 
            designation: 'STC', 
            joining_year: 2020, 
          }, 
          { 
            emp_id: 'EMP02', 
            designation: 'TC', 
            joining_year: 2022, 
          }, 
          { 
            emp_id: 'EMP03', 
            designation: 'TC', 
            joining_year: 2022, 
          }, 
        ]; 
    }

    Make sure to register ag-grid module in main.ts. 

    import { bootstrapApplication } from '@angular/platform-browser'; 
    import { appConfig } from './app/app.config'; 
    import { App } from './app/app'; 
    import { AllCommunityModule, ModuleRegistry } from 'ag-grid-community';  
     
    // Register all community modules     
    ModuleRegistry.registerModules([AllCommunityModule]); 
    
    bootstrapApplication(App, appConfig) 
      .catch((err) => console.error(err));

    Add theme in style.css(global css file) 
    import it from ag-grid-community package

    /* Add application styles & imports to this file! */
    @import "~@ag-grid-community/all-modules/dist/styles/ag-grid.css";
    @import "~@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css";
    Screenshot 2025 07 16 204409

    ag-grid view

    The output of the above screen would show the grid. You can also try adding features and themes provided by ag-grid.

    Reference:Ag Grid Angular 

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleHoneypot Fields in Sitecore Forms
    Next Article How to Use AI Effectively in Your Dev Projects

    Related Posts

    Development

    Blade Service Injection: Direct Service Access in Laravel Templates

    July 24, 2025
    Development

    This Week in Laravel: NativePHP Mobile and AI Guidelines from Spatie

    July 24, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-48274 – WordPress Job Portal SQL Injection

    Common Vulnerabilities and Exposures (CVEs)

    Bungie vaulting Destiny 2 content backfires with the latest Red War lawsuit court ruling

    News & Updates

    CVE-2025-45867 – TOTOLINK A3002R Buffer Overflow

    Common Vulnerabilities and Exposures (CVEs)

    Kadas Albireo is a mapping application based on QGIS

    Linux

    Highlights

    Machine Learning

    This AI Paper from ByteDance Introduces a Hybrid Reward System Combining Reasoning Task Verifiers (RTV) and a Generative Reward Model (GenRM) to Mitigate Reward Hacking

    April 1, 2025

    Reinforcement Learning from Human Feedback (RLHF) is crucial for aligning LLMs with human values and…

    The Elder Scrolls IV: Oblivion Remastered is as my childhood heart remembers it — I’m in tears from Virtuos and Bethesda’s efforts

    April 25, 2025

    11 Vibe Coding Tools to 10x Your Development on Linux Desktop

    April 15, 2025

    How to Set Up Basic jQuery Form Validation in Two Minutes

    July 16, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.