PDA

View Full Version : groupclick event does not work with locked gridcolumns



StigOHara
29 Sep 2015, 11:08 PM
I noticed that the groupclick event does not work once there is one column in a locked state. I suppose this has something to do with the fact that there is actually an extra grid created on the fly. I have made a Sencha Fiddle to see if this behaviour has something to do with the version (4.2.1) of ExtJs I use, but it seems to occur in every version.
Has anyone encountered this as well and, more important, has anyone found a workaround for this.

code:

var store = Ext.create('Ext.data.Store', {
storeId: 'employeeStore',
fields: ['name', 'seniority', 'department'],
groupField: 'department',
data: {
'employees': [{
"name": "Michael Scott",
"seniority": 7,
"department": "Management"
}, {
"name": "Dwight Schrute",
"seniority": 2,
"department": "Sales"
}, {
"name": "Jim Halpert",
"seniority": 3,
"department": "Sales"
}, {
"name": "Kevin Malone",
"seniority": 4,
"department": "Accounting"
}, {
"name": "Angela Martin",
"seniority": 5,
"department": "Accounting"
}]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'employees'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Employees',
forceFit: true,
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [{
text: 'Name',
dataIndex: 'name'
}, {
text: 'Seniority',
dataIndex: 'seniority',
locked: true //alter this line to see change in behaviour
}],
features: [{
ftype: 'grouping'
}],
width: 500,
height: 575,
renderTo: Ext.getBody(),
listeners: {
groupclick: function() {
alert('click');
}
}
});

joel.watson
5 Oct 2015, 11:48 AM
Hi--

If you add the listeners to the viewConfig, it should work as expected.

Thanks
Joel