-
5 Mar 2012 3:18 AM #1
Answered: Grouping feature events don't get triggered
Answered: Grouping feature events don't get triggered
Hi everyone!
I have an issue when using the grid grouping feature.
I'd like to catch the 'click' event so I added the listener like this :
Code:var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{ groupHeaderTpl: 'Cuisine: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})', listeners: { 'click': function() { alert("test"); } } });
And I get this error in console :
I used the sample code : http://dev.sencha.com/deploy/ext-4.0...groupgrid.htmlCode:Uncaught TypeError: Cannot read property 'click' of undefined
The grouping feature works well, I just can't catch the events.
Any idea of what's going on ?
Thanks for your time.
Edit : Same issue with 'groupclick' and 'groupcollapse' events.
-
Best Answer Posted by chramer
try also to add this as a grid property!
Code:viewConfig : { listeners : { 'groupclick' : function() { alert('success'); } } }
-
5 Mar 2012 3:50 AM #2
-
5 Mar 2012 4:30 AM #3
-
5 Mar 2012 5:09 AM #4
it looks like this event is fired on the view
try this :
Code:view : { listeners: { 'groupclick': function() { alert("test"); } }
-
5 Mar 2012 6:39 AM #5
No error message this time but the listeners still dont get triggered

-
5 Mar 2012 6:41 AM #6
try also to add this as a grid property!
Code:viewConfig : { listeners : { 'groupclick' : function() { alert('success'); } } }
-
5 Mar 2012 6:44 AM #7
I finally found the answer. The events are fired on the grid as it's indicate in the documentation, I should have read it more carefully.
I juste added the 'groupclick' listener on the grid and it worked.
Thank you for your time chramer!
Edit : Seems you found it first


Reply With Quote