Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ag-grid-angular
Advanced tools
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/ag-grid/ag-grid/blob/latest/documentation/ag-grid-docs/public/images/ag-logos/svg-logos/AG-Grid-Logo_Dark-Theme.svg?raw=true"/> <source
ag-grid-angular is a powerful data grid component for Angular applications. It provides a wide range of features for displaying, editing, and managing data in a tabular format. It is highly customizable and supports large datasets, making it suitable for enterprise applications.
Basic Grid Setup
This code sets up a basic ag-Grid in an Angular component. The `rowData` and `columnDefs` properties are used to define the data and columns of the grid.
<ag-grid-angular
style="width: 100%; height: 350px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs">
</ag-grid-angular>
Sorting and Filtering
This code enables sorting and filtering on all columns by setting the `sortable` and `filter` properties in the `defaultColDef` object.
<ag-grid-angular
style="width: 100%; height: 350px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs"
[defaultColDef]="{ sortable: true, filter: true }">
</ag-grid-angular>
Row Selection
This code enables multiple row selection in the grid by setting the `rowSelection` property to `multiple`.
<ag-grid-angular
style="width: 100%; height: 350px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs"
rowSelection="multiple">
</ag-grid-angular>
Cell Editing
This code enables cell editing for all columns by setting the `editable` property in the `defaultColDef` object.
<ag-grid-angular
style="width: 100%; height: 350px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs"
[defaultColDef]="{ editable: true }">
</ag-grid-angular>
Pagination
This code enables pagination in the grid and sets the page size to 10 rows per page by using the `pagination` and `paginationPageSize` properties.
<ag-grid-angular
style="width: 100%; height: 350px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs"
pagination="true"
paginationPageSize="10">
</ag-grid-angular>
ngx-datatable is a lightweight Angular component for presenting large and complex data. It offers features like sorting, filtering, and pagination. Compared to ag-grid-angular, ngx-datatable is simpler and may be easier to use for smaller projects, but it lacks some of the advanced features and performance optimizations of ag-grid-angular.
PrimeNG is a comprehensive UI component library for Angular, which includes a powerful data table component. It offers a wide range of features, including sorting, filtering, pagination, and row selection. PrimeNG is comparable to ag-grid-angular in terms of functionality, but it also provides a broader set of UI components beyond just data tables.
Angular Material is the official Material Design component library for Angular. It includes a data table component with features like sorting, pagination, and filtering. While it is not as feature-rich as ag-grid-angular, it integrates seamlessly with other Angular Material components and follows the Material Design guidelines.
AG Grid is a fully-featured and highly customizable Angular Data Grid. It delivers outstanding performance and has no third-party dependencies.
AG Grid is available in two versions: Community & Enterprise.
ag-grid-community
is free, available under the MIT license, and comes with all of the core features expected from a Angular Data Grid, including Sorting, Filtering, Pagination, Editing, Custom Components, Theming and more.ag-grid-enterprise
is available under a commercial license and comes with advanced features, like Integrated Charting, Row Grouping, Aggregation, Pivoting, Master/Detail, Server-side Row Model, and Exporting in addition to dedicated support from our Engineering team.Feature | AG Grid Community | AG Grid Enterprise |
---|---|---|
Filtering | ✅ | ✅ (Advanced) |
Sorting | ✅ | ✅ |
Cell Editing | ✅ | ✅ |
CSV Export | ✅ | ✅ |
Drag & Drop | ✅ | ✅ |
Themes and Styling | ✅ | ✅ |
Selection | ✅ | ✅ |
Accessibility | ✅ | ✅ |
Infinite Scrolling | ✅ | ✅ |
Pagination | ✅ | ✅ |
Server-Side Data | ✅ | ✅ (Advanced) |
Custom Components | ✅ | ✅ |
Integrated Charting | ❌ | ✅ |
Range Selection | ❌ | ✅ |
Row Grouping and Aggregation | ❌ | ✅ |
Pivoting | ❌ | ✅ |
Excel Export | ❌ | ✅ |
Clipboard Operations | ❌ | ✅ |
Master/Detail | ❌ | ✅ |
Tree Data | ❌ | ✅ |
Column Menu | ❌ | ✅ |
Context Menu | ❌ | ✅ |
Tool Panels | ❌ | ✅ |
Support | ❌ | ✅ |
ℹ️ Note:
Visit the Pricing page for a full comparison.
We've created several demos to showcase AG Grid's rich feature set across different use cases. See them in action below, or interact with them on our Demo page.
AG Grid is easy to set up - all you need to do is provide your data and define your column structure.
$ npm install --save ag-grid-angular
1. Import the Angular Data Grid
import { Component } from '@angular/core';
// Angular Data Grid Component
import { AgGridAngular } from 'ag-grid-angular';
// Column Definition Type Interface
import { ColDef } from 'ag-grid-community';
2. Define Rows and Columns
@Component({
selector: 'app-root',
standalone: true,
imports: [AgGridAngular], // Add Angular Data Grid Component
styleUrls: ['./app.component.css'],
template: ``
})
export class AppComponent {
// Row Data: The data to be displayed.
rowData = [
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
{ make: "Ford", model: "F-Series", price: 33850, electric: false },
{ make: "Toyota", model: "Corolla", price: 29600, electric: false },
];
// Column Definitions: Defines the columns to be displayed.
colDefs: ColDef[] = [
{ field: "make" },
{ field: "model" },
{ field: "price" },
{ field: "electric" }
];
}
3. Create the Angular Data Grid Component
template: `
<!-- The AG Grid component -->
<ag-grid-angular
[rowData]="rowData"
[columnDefs]="colDefs" />
`;
4. Styling the Data Grid
Import the required dependencies into your styles.css file.
/* Core Data Grid CSS */
import 'ag-grid-community/styles/ag-grid.css';
/* Quartz Theme Specific CSS */
import 'ag-grid-community/styles/ag-theme-quartz.css';
Add the class and style props to the ag-grid-angular component.
<ag-grid-angular
class="ag-theme-quartz"
style="height: 500px;"
...
/>
ℹ️ Note:
For more information on building Data Grids with AG Grid, refer to our Documentation.
We also provide Seed Projects to help you get started with common configurations:
Environment | Framework | Packages | Modules |
---|---|---|---|
Create React App (CRA) | Packages | Modules | |
Vite | Packages | Modules | |
Vite - TypeScript | Packages | Modules | |
Webpack 5 - TypeScript | Packages | Modules | |
Webpack 5 - Angular | Packages | Modules | |
Angular CLI | Packages | Modules | |
Nuxt | Packages | Modules | |
Vite | Packages | Modules |
AG Grid is fully customisable, both in terms of appearance and functionality. There are many ways in which the grid can be customised and we provide a selection of tools to help create those customisations.
You can create your own Custom Components to customise the behaviour of the grid. For example, you can customise how cells are rendered, how values are edited and also create your own filters.
There are a number of different Component Types that you can provide to the grid, including:
To supply a custom cell renderer and filter components to the Grid, create a direct reference to your component within the gridOptions.columnDefs
property:
gridOptions = {
columnDefs: [
{
field: 'country', // The column to add the component to
cellRenderer: CountryCellRenderer, // Your custom cell component
filter: CountryFilter, // Your custom filter component
},
],
};
AG Grid has 4 themes, each available in light
& dark
modes. We also supply each theme with an auto
mode that can toggle the theme based on the users' system preferences:
Quartz | Material |
---|---|
Alpine | Balham |
To apply a theme, add the relevant CSS Class to the Data Grid container. For example, to apply the Quartz theme, use the CSS class ag-theme-quartz
:
<div
id="myGrid"
style="height: 150px; width: 600px"
class="ag-theme-quartz"
></div>
All AG Grid themes can be customised using CSS variables, or you can create a new theme from scratch with the help of our Theme Builder or Figma Design System.
AG Grid has a large and active community who have created an ecosystem of 3rd party tools, extensions and utilities to help you build your next project with AG Grid, no matter which language or framework you use:
AG Grid is used by 100,000's of developers across the world, from almost every industry. Whilst most of these projects are private, we've curated a selection of open-source projects from different industries where household names use AG Grid, including J.P.Morgan, MongoDB and NASA. Visit our Community Showcase page to learn more.
Founded in 2016, AG Grid has seen a steady rise in popularity and is now the market leader for Data Grids:
AG Grid Enterprise customers have access to dedicated support via ZenDesk, which is monitored by our engineering teams.
If you have found a bug, please report it in this repository's issues section.
Look for similar problems on StackOverflow using the ag-grid
tag. If nothing seems related, post a new message there. Please do not use GitHub issues to ask questions.
AG Grid is developed by a team of co-located developers in London. If you want to join the team send your application to info@ag-grid.com.
ag-grid-community
is licensed under the MIT license.
ag-grid-enterprise
has a Commercial license.
See the LICENSE file for more info.
If you've made it this far, you may be interested in our latest project: AG Charts - The best Angular Charting library in the world.
Initially built to power Integrated Charts in AG Grid, we open-sourced this project in 2018. Having seen the steady rise in popularity since then, we have decided to invest in AG Charts with a dedicated Enterprise version (ag-charts-enterprise
) in addition to our continued support of ag-charts-community
.
FAQs
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/ag-grid/ag-grid/blob/latest/documentation/ag-grid-docs/public/images/ag-logos/svg-logos/AG-Grid-Logo_Dark-Theme.svg?raw=true"/> <source
The npm package ag-grid-angular receives a total of 139,048 weekly downloads. As such, ag-grid-angular popularity was classified as popular.
We found that ag-grid-angular demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.