Join Virtual JavaScript Days 2026 and Get a Free Participation Certificate – Register Now!

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

March 5, 2020 3303 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.

Recommended Articles

Building Responsive, Data-Driven Enterprise Applications with JavaScript

In enterprise software, responsiveness is no longer a nice-to-have. Users expect the same application to perform smoothly whether they are working at a desktop with…

What’s New in ReExt 1.2

Modern teams are under constant pressure to ship faster without sacrificing UX quality, maintainability, or enterprise-grade capabilities. That’s easy to say, but much harder to…

BFF Architecture – Optimizing Communication between Node. js and Ext JS

Modern enterprise applications rarely struggle because they lack features. More often, they struggle because the frontend and backend are speaking slightly different languages. Your database…

Case Study: Building a Modern Recruitment Application with Ext JS

Hiring the right talent requires more than collecting resumes. Modern recruitment teams need streamlined workflows, real-time visibility, and reliable tools that support every stage of…

Techniques for Handling Large Data Sets in Ext JS

Enterprise applications often need to display and process thousands – or even millions – of records while maintaining a responsive and intuitive user experience. Whether…

Building an AI-Powered School Grading System with Ext JS

Educational institutions are under increasing pressure to evaluate growing numbers of student assessments while maintaining fairness, consistency, and timely feedback. Although artificial intelligence offers new…

View More
JS Days Popup