suamikim
20 Jun 2012, 2:34 AM
Hi there,
I just discovered 2 things:
1.)
The groupcollapse- & groupexpand-events are not fired by the Grouping-feature itself (like it would have seemed to me because of the docu: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.feature.Grouping-event-groupcollapse (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.grid.feature.Grouping-event-groupcollapse)).
Acually it is fired by the view which can be seen in the Ext-Source. This alone wouldn't be a problem if one is aware of it...
2.)
The two mentioned events don't supply any helpful arguments. Actually they don't supply anything at all:
36368
Am i doing anything wrong here or is this a bug in Ext? Currently I'm working with version 4.0.2a.
Thanks
Example-Code:
Ext.onReady(function() {
var store = Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'sex'],
data: {'items':[
{ 'name': 'Lisa', 'email': 'lisa@c.com', 'sex': 'female' },
{ 'name': 'Bart', 'email': 'bart@a.com', 'sex': 'male' },
{ 'name': 'Homer', 'email': 'home@d.com', 'sex': 'male' },
{ 'name': 'Marge', 'email': 'marge@b.com', 'sex': 'female' }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
},
groupField: 'sex'
});
var grid = Ext.create('Ext.grid.Panel', {
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ header: 'Name', dataIndex: 'name' },
{ header: 'Email', dataIndex: 'email', flex: 1, field: 'textfield' }
],
features: [{ftype:'grouping'}],
hideHeaders: true
});
Ext.create('Ext.window.Window', {
width: 350,
height: 200,
layout: "fit",
items: grid
}).show();
grid.view.addListener('groupcollapse', function() {
console.warn(arguments);
}, this);
grid.view.addListener('groupexpand', function() {
console.warn(arguments);
}, this);
});
I just discovered 2 things:
1.)
The groupcollapse- & groupexpand-events are not fired by the Grouping-feature itself (like it would have seemed to me because of the docu: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.feature.Grouping-event-groupcollapse (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.grid.feature.Grouping-event-groupcollapse)).
Acually it is fired by the view which can be seen in the Ext-Source. This alone wouldn't be a problem if one is aware of it...
2.)
The two mentioned events don't supply any helpful arguments. Actually they don't supply anything at all:
36368
Am i doing anything wrong here or is this a bug in Ext? Currently I'm working with version 4.0.2a.
Thanks
Example-Code:
Ext.onReady(function() {
var store = Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'sex'],
data: {'items':[
{ 'name': 'Lisa', 'email': 'lisa@c.com', 'sex': 'female' },
{ 'name': 'Bart', 'email': 'bart@a.com', 'sex': 'male' },
{ 'name': 'Homer', 'email': 'home@d.com', 'sex': 'male' },
{ 'name': 'Marge', 'email': 'marge@b.com', 'sex': 'female' }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
},
groupField: 'sex'
});
var grid = Ext.create('Ext.grid.Panel', {
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ header: 'Name', dataIndex: 'name' },
{ header: 'Email', dataIndex: 'email', flex: 1, field: 'textfield' }
],
features: [{ftype:'grouping'}],
hideHeaders: true
});
Ext.create('Ext.window.Window', {
width: 350,
height: 200,
layout: "fit",
items: grid
}).show();
grid.view.addListener('groupcollapse', function() {
console.warn(arguments);
}, this);
grid.view.addListener('groupexpand', function() {
console.warn(arguments);
}, this);
});