How to add a loading in React AG Grid

Today we’ll show you how to add a loading in React AG Grid.

In the previous article, we have implement server side pagination in React AG Grid. Here, we’ll show you how to show loading during an API call and how to hide it after receiving a response.

Demo Application

Output - How to add a loading in React AG Grid - Clue Mediator
Output – How to add a loading in React AG Grid – Clue Mediator

Steps to add a loading in AG Grid

  1. Load data using API in AG Grid
  2. Add loading in Grid
  3. Output

1. Load data using API in AG Grid

First of all, we have to implement the React AG Grid and integrate the API in AG Grid. Check the following article to implement server-side pagination in React AG Grid.

Implement server side pagination in React AG Grid

App.js

2. Add loading in Grid

We will use the overlay to add the loading indicator in the Grid.

We can also add the custom template using the overlayLoadingTemplate and overlayNoRowsTemplate. Check the following code to show/hide a loading template.

3. Output

Let’s combine all the code together and see how it looks.

App.js

Run the application and check the output in the browser.

I hope you find this article helpful.
Thank you for reading. Happy Coding..!! 🙂

Demo & Source Code

GitHub Repository StackBlitz Project
If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

2 Responses

  1. pharmacies says:

    Hello, I think your blog might be having browser compatibility issues. When I look at your website in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, awesome blog!

Leave a Reply

Your email address will not be published. Required fields are marked *