Missed JavaScript Days 2026? The Replays Are Now Available – Watch Now!

How to Quickly Customize Ext JS Data Grid (Part 2/6) – Grouping Methods

March 5, 2020 3496 Views

Get a summary of this article:

Show

In the first blog of this 6-part “Ext JS Grid Customization” blog series, we saw a few different ways to use built-in grid and column properties to customize a data grid. This blog demonstrates the use of built-in data display methods to quickly customize your data grid. The example grid used here displays NBA 2020 player ratings.

This blog demonstrates grid customization using ‘Grouping Methods’.

 

Grouped Grid

A grouped grid provides useful views of the row/column data by enabling data aggregation into groups.

Grid Grouping
Here’s the code that enables the feature:

1. Activate feature in grid configuration:features: [{
ftype: ‘grouping’
}],

2. Define group field in store configuration:store: {
model: ‘Player’,
//Define group field
groupField: ‘team’,
data: [/* … */] },

3. Customize grid (customize header or/and add summary row)features: [{
ftype: ‘grouping’,
//Customize group header
groupHeaderTpl: ‘Team: {name}’,
//Show summary row
showSummaryRow: true
}],

columns: [{
dataIndex: ‘player’,
flex: 1,
text: ‘Name’,
//Add a summary row
summaryType: ‘count’,
//Customize summary display
summaryRenderer: function (value) {
return Ext.String.format(‘{0} player{1}’, value, value !== 1 ? ‘s’ : ”);
}
},{
dataIndex: ‘rating’,
text: ‘Rating’,
//Add a summary row
summaryType: ‘average’,
flex: 1
}]

Explore the code in the Fiddle Tool:

Grouped Grid Header

Users can customize header display by using grouped grid header

Grouped Grid

Here’s the code that groups the column display header:columns: [{
dataIndex: ‘player’,
flex: 1,
text: ‘Name’,
},{
text: ‘Rating’,
columns: [{
dataIndex: ‘rating’,
text: ‘Overall rating’,
flex: 1
},{
dataIndex: ‘threePointRating’,
text: ‘3PT rating’,
flex: 1
},{
dataIndex: ‘dunkRating’,
text: ‘Dunk rating’,
flex: 1
}] },{
dataIndex: ‘position’,
text: ‘Position’,
flex: 1
},{
dataIndex: ‘ht’,
text: ‘Height’,
flex: 1
}]

Explore the code in the Fiddle Tool:

Stay tuned for our next blog covering “Row Editing” methods to customize grids.

 

Build Your Data Grid with Ext JS 7.1

The free 30-day trial of Ext JS 7.1 provides full access to the product features. Get started today and see how you can build a high-performing data grid for your application.

Author

Kirti Joshi

Kirti Joshi is long time techie and has worked at a number of companies delivering cutting-edge hardware and software products. She currently works as a Product Marketing Manager at Sencha and is passionate about technology products that improve human life.

Recommended Articles

How to Use Tailwind CSS v4 in Ext JS (Classic) Without Breaking the Theme

We know that Ext JS is a war tank. When it comes to handling absurd volumes of data and complex front-end architectures, few frameworks come…

How to Use the Ext JS Grid in React: Setup, Columns, Editing and Grouping

Set up the Ext JS grid in React with ReExt, then add typed columns, store-backed data, inline editing, grouping and summaries. Full code included. The…

Understanding Ext JS Layouts and Containers: An Introduction (Classic vs. Modern)

Building complex, responsive, and data-intensive Web applications requires a solid layout engine. In Ext JS, the layout system is the backbone of your Application UI.…

AI-Driven Test Grading with Ext JS, Node.js, and OpenAI: A Secure Enterprise Architecture

Learn how to build an AI-driven test grading system with Ext JS, Node.js, MySQL, and OpenAI using secure API architecture, deterministic scoring, and human oversight.…

Sencha AI Just Got a Lot Bigger: One Chatbot, Every Sencha Product

Sencha’s AI assistant has grown from a focused Ext JS helper into a product-aware chatbot covering the whole Sencha suite. Here’s what’s new and why…

Building High-Performance Real-Time Operational Dashboards with Ext JS and React

Real-time operational dashboards are no longer simply reporting interfaces. In logistics, fleet management, supply chain operations, financial services, and other data-intensive environments, they are part…

View More