Currently, I am trying to find a solution to organize my data by months and then further group the months by years. At the moment, I have only been able to group the data by years.
Is there someone who can assist me with this issue?
This is my model:
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
// 'name',
// 'email',
'phone' ]});
Here is some sample data:
var userStore = Ext.create('Ext.data.Store', {
model: 'User',
data: [
{ year: '2015', month : 'march', phone: '555-111-1224' },
{ year: '2015', month : 'april', phone: '555-222-1234' },
{ year: '2014', month : 'march', phone: '555-222-1244' },
{ year: '2014', month : 'april', phone: '555-222-1254' }
],
groupField: 'year'});
Below is the code for the grid:
Ext.application({
name : 'MyApp',
launch : function() {
Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
features: [{ ftype: 'grouping' }],
store: userStore,
width: 250,
height: 300,
title: 'Application Users',
columns: [
{
text: 'Phone Number',
flex: 1,
dataIndex: 'phone',
sortable: false,
hideable: false
}
]
});
}});
Thank you in advance for your help!