Build a powerful DataGrid in few hours with Ag Grid

Rate this content
Bookmark
The video demonstrates how to efficiently create a robust data grid using AG Grid within a few hours. Key aspects include column definitions, which specify the name and field of the row object, and can handle nested properties using dot notation. AG Grid version 28 offers improved TypeScript typings for enhanced type checking. The tutorial primarily uses the client-side row model, but mentions other models like the infinite row model and server-side row model available in the Enterprise Edition. The video also covers binding column definitions and row data to the AG Grid React component, enabling sorting and multi-sorting features. Users can customize the sorting order and multi-sort key, making it flexible for different requirements. Additionally, the video touches on AG Grid's support for CSS variables and SAS rules for advanced customization, and the use of AG Grid's module system to control bundle size. The video includes examples of cell rendering, custom cell renderers, and value getter functions to manipulate data presentation. It also highlights AG Grid's built-in cell editors and custom cell editors using React components, along with styling options for cells and rows. The video concludes with a discussion on AG Grid's performance optimization techniques for handling large datasets efficiently.

From Author:

Does your React app need to efficiently display lots (and lots) of data in a grid? Do your users want to be able to search, sort, filter, and edit data? AG Grid is the best JavaScript grid in the world and is packed with features, highly performant, and extensible. In this workshop, you’ll learn how to get started with AG Grid, how we can enable sorting and filtering of data in the grid, cell rendering, and more. You will walk away from this free 3-hour workshop equipped with the knowledge for implementing AG Grid into your React application.


We all know that rolling our own grid solution is not easy, and let's be honest, is not something that we should be working on. We are focused on building a product and driving forward innovation. In this workshop, you'll see just how easy it is to get started with AG Grid.


Prerequisites: 

Basic React and JavaScript


Workshop level: 

Beginner

This workshop has been presented at React Summit US 2023, check out the latest edition of this React Conference.

FAQ

AG Grid is a powerful JavaScript data grid that provides an Excel-like experience for visualizing data. It is used for its high performance on large data sets and its extensive features like real-time data editing, sorting, filtering, and visualization with charts and graphs.

You can access the workshop materials by visiting the website 'liveloveapp.com/courses'. Once there, select the 'Getting Started with AG Grid and React' workshop to find the slides, exercises, and challenges.

AG Grid is known for handling millions of rows of data with excellent performance. Its unique features include real-time data editing, data pivoting, and the ability to create complex visualizations like charts and graphs. Additionally, it supports various data models such as client-side, infinite, and server-side row models.

AG Grid's appearance can be customized using themes like Alpine or Material, which can be applied by importing them into your project. Additionally, you can use CSS or SASS for more detailed customization, adjusting properties like colors, padding, and borders to fit the design of your application.

Yes, AG Grid allows direct data editing within the grid. You can enable cell editing by setting the 'editable' property in the column definitions. Changes can be managed on the client side or synchronized with a server for persistence, using events like 'onCellValueChanged' to handle data updates.

To run AG Grid with React, you need to install the AG Grid community package and the AG Grid React package. These packages provide the necessary grid functionalities and React component bindings. You also need to import at least one theme from AG Grid to style the grid.

AG Grid handles large datasets efficiently through its optimized performance and use of advanced row models like the infinite row model and the server-side row model. These models manage data loading dynamically, only fetching data as needed, which keeps the grid responsive and fast even with large datasets.

Mike Ryan
Mike Ryan
96 min
08 Nov, 2023

Comments

Sign in or register to post your comment.

Video Transcription

1. Introduction to AG Grid and React Workshop

Short description:

Good morning! I'm Mike Ryan, a Google Developer Expert in Angular and Web Technologies. Today, we're going to talk about AG Grid. This workshop is different as everything is online. Go to liveloveapp.com/courses and select the Getting Started with AG Grid and React workshop. We'll be using StackBlitz for exercises. Let's get started!

Alright, good morning everybody. I'm really excited to be your Workshop Instructor today. My name is Mike Ryan. I'm a Google Developer Expert in Angular and Web Technologies. If you know me from the Angular space, then you have probably used some of my open source work including ngRx, the Redux for Angular. And I'm also an AG Grid expert. And so I'm really excited to talk to you about AG Grid today. I'm also a software architect at LiveLoveApp.

Now in terms of this workshop, it's a little different than other workshops in that all the slides, exercises, and challenges are all going to be online today. So if you want, you're going to go to liveloveapp.com slash courses. And let me show you what you're going to see once you go to that link. So if you go to liveloveapp.com slash courses, you're to see a couple of different workshops to select from. We're going to be doing the Getting Started with AG Grid and React workshop. And so you're going to hit let's go on that. And then you'll see the full table of contents. I'm going to go through these slides today. But as you go through them, you can hit period on your keyboard to put it into slide mode and follow along with me. Additionally, at the end of each sort of section or chapter, there's going to be a challenge or an exercise for us to complete together. These are all going to be done on StackBlitz, an online IDE. So you don't have to worry about getting NPM dependencies installed or get anything running locally. We're going to do all of our exercises today using StackBlitz. So, again, I'm going to give everyone just a second to pull that up. You're going to go to liveloveapp.com slash courses, and then you're going to pick on the getting started with AG Grid and React in two hours workshop. And then once everyone's gotten a moment to pull that up and get that loaded, we will proceed from there. Again, liveloveapp.com slash courses, and then click on the Getting Started with AG Grid and React in Two Hours workshop.

2. Introduction to AG Grid and Column Definitions

Short description:

AG Grid is a powerful JavaScript grid that provides an Excel-like experience for visualizing data. It can handle millions of rows of data, supports powerful Excel-like functionality, and is used in various applications such as sports betting, financial transactions, and real-time log visualization. To install AG Grid with React, you need to install the AG Grid community package and the AG Grid React modules. AG Grid is free and comes with a React wrapper. You can import themes to customize the appearance of AG Grid, and we will cover custom styling in detail during this workshop. The most important construct in AG Grid is the column definition, which instructs AG Grid on how to represent properties in the data set. To use AG Grid, you define column definitions, import the AG Grid React component, and bind to the column definitions property. Each column definition specifies the field to display and its header name.

All right, while everyone's pulling that up, I want to give just a little introduction to what AG Grid is. So AG Grid is one of the most powerful JavaScript grids in the world. It provides an Excel-like experience for visualizing data. And the thing that makes AG Grid really unique is that it's had a really focused amount of work on performance. So AG Grid can handle, in my experience, millions of rows of data. It can do some really powerful Excel-like functionality like pivoting data, making data editable in real time from the user's perspective, visualizing data with charts and graphs. Pretty much anything that you might need to reach for a data grid for, AG Grid can handle. And so we really like teaching AG Grid because we use it on a lot of our client projects at LiveLoveApp, where I'm one of the software architects on staff. And for our clients, we've seen them do everything from sports betting to financial transactions to visualizing real-time logs coming off of a backend server. And so AG Grid is a really dynamic and powerful library.

To install AG Grid with React, let's just kind of jump into it. To get started, if you were to be doing this locally, again, you don't have to do this on your machines this morning because we'll be doing everything in StackBlitz. But if you wanted to do this in your React project, you'd get started by installing the AG Grid community package and the AG Grid React modules. Now, a quick naming note about this, AG Grid is free. It is completely free out of the box using the AG Grid community package. There's also an enterprise version of AG Grid that comes with more powerful features. All the things that we'll be teaching today, though, come in this community edition of AG Grid that's provided completely free with online open source support. And then the AG Grid React Package is going to provide us React-native bindings to AG Grid directly, and so that's what we'll be using today to interact with AG Grid is we're going to be using the React wrapper around it. Additionally, you need to import at least a theme to get started. So AG Grid is not themed out of the box. It doesn't apply any CSS. This is really great if you have the time and energy to go build out a custom theme and you really wanna get detailed about the way AG Grid looks and behaves for your application, but it also comes with some great themes out of the box. So if you were to be using AG Grid on your project today, you could import one of the themes from the styles folder in the AG Grid community package. for our exercises, we'll be using the Alpine theme. It's a great little theme. They also have built-in ones that give you a material-style look. So if you're looking for more of like a Google Material Flair, that's available to you, as well. As a note, we will be covering more custom styling in detail during this workshop today. So if you're curious about how to get to some of that custom styling functionality with AG Grid, don't worry. We will be covering it. So with that, let's just jump right on into AgGrid and talk about how to use it.

So the most important construct in AgGrid is something called the column definition, right? AgGrid is going to be a data grid, and so it's going to be built on top of columns and rows of data. and when you're displaying data with AG Grid, by default, it's going to show each item in your collection of data as a row in this grid, and so the columns and the column definitions are going to instruct AG Grid on how to actually represent different properties within that data set. Each column that we want to show on our grid is going to be defined using a CallDef object. By default, columns are going to be positioned in the order that matches the column definition specified. So, we're going to pass AGGRID kind of an array of column definitions. And starting from the top going down, it's going to be the same order we'll see the columns in our application going from left to right. To get started with it, you're going to define some column definitions, and then you're going to import the AGGRID.react component from that AGGRID.react package. It's just a React component, so you're going to drop it inside of whatever React component you want to render the grid in. And then you're going to bind to the column definitions property on that AG React component. From there, you can start to define those column definitions. So in this example, I have an interface for row data. And in this collection of data, I've got a name and a color. And so you can imagine that I'm just showing a bunch of colors and their names here. And if I wanted to create some column definitions to show this data, well, I'm going to create a little array here. I'm using the use state callback hook so that I can make this list of column definitions dynamic. And so I've got my column definitions here. And you can see that I've got my first column is going to show the name field. And I'm going to give it a header name of name. And then for my second column, I'm going to show the field color from this data set and give it the name color.

QnA

Watch more workshops on topic

Hands-on with AG Grid's React Data Grid
React Summit 2022React Summit 2022
147 min
Hands-on with AG Grid's React Data Grid
WorkshopFree
Sean Landsman
Sean Landsman
Get started with AG Grid React Data Grid with a hands-on tutorial from the core team that will take you through the steps of creating your first grid, including how to configure the grid with simple properties and custom components. AG Grid community edition is completely free to use in commercial applications, so you'll learn a powerful tool that you can immediately add to your projects. You'll also discover how to load data into the grid and different ways to add custom rendering to the grid. By the end of the workshop, you will have created an AG Grid React Data Grid and customized with functional React components.- Getting started and installing AG Grid- Configuring sorting, filtering, pagination- Loading data into the grid- The grid API- Using hooks and functional components with AG Grid- Capabilities of the free community edition of AG Grid- Customizing the grid with React Components
Build a Powerful Datagrid With AG Grid
React Summit 2024React Summit 2024
168 min
Build a Powerful Datagrid With AG Grid
WorkshopFree
Brian Love
Brian Love
Does your React app need to efficiently display lots (and lots) of data in a grid? Do your users want to be able to search, sort, filter, and edit data? AG Grid is the best JavaScript grid in the world and is packed with features, highly performant, and extensible. In this workshop, you’ll learn how to get started with AG Grid, how we can enable sorting and filtering of data in the grid, cell rendering, and more. You will walk away from this free 3-hour workshop equipped with the knowledge for implementing AG Grid into your React application.
Get started with AG Grid Angular Data Grid
JSNation 2022JSNation 2022
116 min
Get started with AG Grid Angular Data Grid
WorkshopFree
Stephen Cooper
Stephen Cooper
Get started with AG Grid Angular Data Grid with a hands-on tutorial from the core team that will take you through the steps of creating your first grid, including how to configure the grid with simple properties and custom components. AG Grid community edition is completely free to use in commercial applications, so you’ll learn a powerful tool that you can immediately add to your projects. You’ll also discover how to load data into the grid and different ways to add custom rendering to the grid. By the end of the workshop, you will have created and customized an AG Grid Angular Data Grid.
Contents:- getting started and installing AG Grid- configuring sorting, filtering, pagination- loading data into the grid- the grid API- add your own components to the Grid for rendering and editing- capabilities of the free community edition of AG Grid
Getting Started with AG Grid and React – The Best Javascript Grid in the World
React Advanced Conference 2022React Advanced Conference 2022
140 min
Getting Started with AG Grid and React – The Best Javascript Grid in the World
WorkshopFree
Brian Love
Brian Love
Does your React app need to efficiently display lots (and lots) of data in a grid? Do your users want to be able to search, sort, filter, and edit data? AG Grid is the best JavaScript grid in the world and is packed with features, highly performant, and extensible. In this workshop, you’ll learn how to get started with AG Grid, how we can enable sorting and filtering of data in the grid, cell rendering, and more. You will walk away from this free 3-hour workshop equipped with the knowledge for implementing AG Grid into your React application.
We all know that rolling our own grid solution is not easy, and let's be honest, is not something that we should be working on. We are focused on building a product and driving forward innovation. In this workshop, you'll see just how easy it is to get started with AG Grid.
Prerequisites: Basic React and JavaScript
Workshop level: Beginner
Live Coding Workshop to Setup Rollbar Error Monitoring
TypeScript Congress 2023TypeScript Congress 2023
48 min
Live Coding Workshop to Setup Rollbar Error Monitoring
WorkshopFree
Nico Krüger
Nico Krüger
During this session you will learn how to create a new Rollbar account and integrate the Rollbar SDK with your application to monitor errors in real-time and respond and fix those errors. We will also cover how to customize payload data sent to Rollbar to extend your monitoring capabilities.

Agenda:- Create a Rollbar Account (Free Account)- Integrate your application with the Rollbar SDK- Send handled and unhandled errors to Rollbar- Add Custom payload data to your configuration.
Building a Serverless GraphQL API For Any Datasource With StepZen
GraphQL Galaxy 2021GraphQL Galaxy 2021
75 min
Building a Serverless GraphQL API For Any Datasource With StepZen
WorkshopFree
Roy Derks
Roy Derks
Want to get started with building a GraphQL server but have no idea where to begin? Every (frontend) developer asks for a GraphQL API but often lacks the backend knowledge to create a performant one. There are many different flavours in creating the perfect GraphQL server, ranging from schema-first to code-first or even auto-generated solutions.

In this interactive workshop, you will learn about building a serverless GraphQL API using StepZen. With StepZen, you can create a GraphQL for any data source (SQL, NoSQL & REST) and even other GraphQL APIs within minutes. And even handle more complicated use cases such as authentication and deployment. Using little code, you'll get to combine different data sources in one fully performant API that you can use in your applications from day one.

Table of contents:
- What is StepZen?
- Connecting to a data source (SQL, NoSQL & REST)
- Using custom directives
- Handle sequence flows
- Deployment

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

(Easier) Interactive Data Visualization in React
React Advanced Conference 2021React Advanced Conference 2021
27 min
(Easier) Interactive Data Visualization in React
Top Content
This Talk is about interactive data visualization in React using the Plot library. Plot is a high-level library that simplifies the process of visualizing data by providing key concepts and defaults for layout decisions. It can be integrated with React using hooks like useRef and useEffect. Plot allows for customization and supports features like sorting and adding additional marks. The Talk also discusses accessibility concerns, SSR support, and compares Plot to other libraries like D3 and Vega-Lite.
Safely Handling Dynamic Data with TypeScript
Node Congress 2021Node Congress 2021
29 min
Safely Handling Dynamic Data with TypeScript
Top Content
This Talk discusses the safe handling of dynamic data with TypeScript using JSON Schema and TypeBox. Fastify, a web framework, allows developers to validate incoming data using JSON schema, providing type safety and error handling. TypeBox is a powerful library that allows developers to define JSON schemas and derive static types in TypeScript. The combination of JSON schema, TypeBox, and Fastify provides powerful tools for type safety and validation of dynamic data.
Apache Kafka Simply Explained With TypeScript Examples
JSNation 2023JSNation 2023
27 min
Apache Kafka Simply Explained With TypeScript Examples
Top Content
Apache Kafka is a distributed, scalable, and high-throughput event streaming platform that plays a key role in event-driven architecture. It allows for the division of monolithic applications into independent microservices for scalability and maintainability. Producers and consumers are the key components in Kafka, allowing for a decoupled system. Kafka's replication and persistent storage capabilities set it apart from alternatives like Redis and RabbitMQ. Kafka provides easy access to real-time data and simplifies real-time data handling.
The Art of Functional Programming
React Summit 2022React Summit 2022
26 min
The Art of Functional Programming
Functional programming is a beautiful paradigm that allows us to understand programs and how entities behave and interact. It has nice characteristics like predictability, which makes testing and debugging easier. We explore how functional programming handles side effects and generative art. We learn about drawing patterns and grids with recursive functions, handling state in functional programming, and creating fashion using functional programming techniques. We also discuss handling randomness in functional programming and how to introduce organic variation and randomness to art while maintaining predictability.
GPU Accelerating Node.js Web Services and Visualization with RAPIDS
JSNation 2022JSNation 2022
26 min
GPU Accelerating Node.js Web Services and Visualization with RAPIDS
Welcome to GPU Accelerating Node.js Web Services and Visualization with Rapids. Rapids aims to bring high-performance data science capabilities to Node.js, providing a streamlined API to the Rapids platform without the need to learn a new language or environment. GPU acceleration in Node.js enables performance optimization and memory access without changing existing code. The demos showcase the power and speed of GPUs and rapids in ETL data processing, graph visualization, and point cloud interaction. Future plans include expanding the library, improving developer UX, and exploring native Windows support.
Content Modeling for React Developers
React Summit 2022React Summit 2022
7 min
Content Modeling for React Developers
Haushal, a Developer Advocate at Contentful, discusses content modeling and its importance in providing a great user experience. He uses his Cookbook web app as an example to explain how he structures and organizes content. The overall content model emphasizes reusability and considerations for content governance and platform selection. Content modeling is an iterative process, and Haushal provides resources for further learning and development.