How to get Grid API and Column API in AG Grid

In this article, we will show you how to get Grid API and Column API in AG Grid. If you wish to integrate the AG Grid, you might need to perform additional actions using the Grid API or Column API. So here, we’ll walk you through the process of getting the Grid Options.

Package Version

ag-grid-react
^25.2.0
ag-grid-community
^25.2.1

Steps to get Grid API and Column API

  1. Add AG Grid in React Component
  2. Add an event callback
  3. Output

1. Add AG Grid in React Component

Let’s create a react application using the create-react-app and implement AG Grid in React. Check the following article for more information.

How to implement AG Grid in React

2. Add an event callback

Now, in order to obtain the grid options, we must add the onGridReady() event callback. Look at the following code.

3. Output

In the console window, you will find the grid API and the column API event object that help you to perform grid operations.

Output - How to get Grid API and Column API in AG Grid - Clue Mediator
Output – How to get Grid API and Column API in AG Grid – Clue Mediator

That’s it for today.
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...

Leave a Reply

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