Introducing Version 18 of ag-Grid

  |   Releases
Hero banner: ag-Grid logo over a forest road leading into the sunset
ag-Grid | Version 18

Hey there! Just a few days ago we released a completely new version 18 of ag-Grid. This is a major update, so besides fixing a bunch of bugs and improving performance through underlying architectural changes, we’ve added a number of very interesting features. Most of the work was focused around the pivot table mode and filtering. Let me walk you through the new features.

For a complete list of changes see our changelog.

Multiple filtering conditions

Previously, you could only define one condition for a column filter. Now, Text, Number and Date column filters support two conditions which can be grouped using AND/OR grouping operator.

In the example below, we’re filtering out records to only show “Celica” and “Mondeo” models. And we use OR filtering operator to show records that match both conditions.

Animation: Model filter set to contains 'Celica' OR contains 'Mondeo', leaving only Celica and Mondeo rows
Multiple Filtering Conditions

You can read more about it in the documentation.

Grand column totals

Previous versions of the grid gave you the ability to find out subtotals for each group:

Grid grouped by country with highlighted subtotal rows: Total United States 552 gold, Total Russia 234 gold
Previous Version

We have now added the grand total for columns across all groups:

Grid with a highlighted grand total row at the bottom: 3143 gold, 3131 silver and 3255 bronze
Version 18

You can read more about it in the documentation.

Pivot Totals

We continue advancing our ag-Grid’s pivot table functionality to make the analytics process even more efficient. This time we’ve added support for grand totals across column and row groups.

Column group totals

Suppose you have the following data in the grid:

Flat grid of Olympic athletes with age, country, sport, year, date and gold medals; Michael Phelps first with 8
Column Group Total | Individual Gold Medals

Now you want to see how many gold medals each country won in each year. For that you need to group by a country and pivot on a year. If you do that here is what you will have in the grid:

Pivot grouped by country with gold medals per year from 2000 to 2012; United States won 130 in 2000
Column Group Total | Country Gold Medals

The pivot table shows us that the United States won 130 gold medals in 2000.

But what if you now want to see the total of gold medals won by the United States for all years? In this release we have added the new grand total option for column groups. When applied, the grid has a new column that shows the grand total for all years:

Pivot with a highlighted 'Grand total of Gold' column: United States 552, Russia 234, Australia 163
Version 18 | Addition of Grand Total

Row Totals

Based on the same set of data, imagine that we also need to add Silver and Bronze medals to the picture. So you have the following representation of the grid:

Pivot by year with gold, silver and bronze columns per country for 2000, 2002 and 2004
Column Group Total | Gold, Silver and Bronze

What if you now want to know how many medals of all kinds a country won in each year? This kind of total values is another new feature that we’ve introduced. Once enabled, you will have a new column added showing you totals across all medals within a year.

Year 2000 group with a highlighted Total column after bronze: United States 243, Russia 187, Australia 183
Column Group Total | Country, all Medals Total

And it also includes a handy sliding mechanism that allows expand or collapse all values within a pivoted group. In our example with medals, you can show or hide details for each kind of medals within a year.

Animation: clicking the year header arrow collapses gold, silver and bronze into a Total column, then expands it again
Version 18 | Expand and Collapse Column Group

You can read more it in the documentation.

Row Spanning

By default, each cell takes up the height of one row. You can now change this behavior to allow cells to span multiple rows. This feature is similar to ‘cell merging’ in ‘Excel or ‘row spanning’ in HTML tables.

On the screenshot below the cells that span multiple rows are highlighted in cyan. You can see the first cell spans 2 rows, second and third span 4 rows.

Animation: scrolling a grid where cyan athlete cells span several rows, such as Ryan Lochte across 4 rows

You can read more about it in the documentation.

Printing

When the data shown in a grid needs to printed, it’s often desirable to not constrain grid dimensions on the web page so that when printed it shows full set of data. A grid with unrestricted height and weight also doesn’t have scrollbars as they make no sense on a printed paper.

For example, instead of having a grid printed with scrollbars:

Placeholder Latin text above a small car grid cut off after five rows, with vertical and horizontal scrollbars
Grid Printed with Scrollbar

You want the grid to occupy the space it requires to show full data set:

The same page with the car grid expanded to show every row and the price, year and country columns, no scrollbars
Grid | Occupying Space Required to Show Full Data Set

Previously you only could pass width and height dimensions as configuration options only before the grid was initialized. You can now do it dynamically after the grid has been initialized.

Check out the documentation to learn how to do it.

Embracing Flex layout

In this release we’ve also boosted the grid’s performance even further by redesigning part of ag-Grid’s internal layout mechanism with CSS Flexible Box Layout (Flexbox). As you know, Flexbox has been around for quite a while but we couldn’t take advantage of it because IE9 didn’t support it. Now that we have dropped the support for this version of Internet Explorer as no one uses it, we can delegate most of the heavy lifting of layouting to native browsers implementation. The new layout structure doesn’t need a polling setTimeout function running every 500 ms and a bunch of redundant wrapper DIV elements. That’s where the performance improvements come from.


Learn more about AG Grid — High Performance Enterprise JavaScript Data Grid. Supporting multiple frameworks: Angular, Vue, React so you can pick the best framework for your needs.

Read more posts about...