PDA

View Full Version : How to add an action to Group Header icon



DineshGudikandula
19 Jul 2012, 11:04 PM
How can add an action to Group Header icon.Problem is when i click on icon it performs minimize and maximize of group not user specified action.plz give me the solution..

redraid
20 Jul 2012, 1:40 AM
Try this


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',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Seniority', dataIndex: 'seniority' }
],
features: [{ftype:'grouping'}],
width: 200,
height: 275,
renderTo: Ext.getBody(),
viewConfig: {
listeners: {
groupclick: function (view, node, group, e, eOpts) {
alert('click');

// Disable expand/collapse
e.preventDefault();
return false;
}
}
}
});