1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    15
    Vote Rating
    1
    Salah91 is on a distinguished road

      1  

    Default 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 :
    Code:
    Uncaught TypeError: Cannot read property 'click' of undefined
    I used the sample code : http://dev.sencha.com/deploy/ext-4.0...groupgrid.html
    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.

  2. try also to add this as a grid property!
    Code:
            viewConfig : {
                listeners : {
                    'groupclick' : function() {
                        alert('success');
                    }
                }
            }

  3. #2
    Sencha User chramer's Avatar
    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    208
    Vote Rating
    10
    Answers
    42
    chramer will become famous soon enough

      0  

    Default


    Ext.grid.feature.Grouping doesn't have the 'click' event!
    I think you need groupclick

  4. #3
    Sencha User
    Join Date
    Jan 2010
    Posts
    15
    Vote Rating
    1
    Salah91 is on a distinguished road

      0  

    Default


    Quote Originally Posted by chramer View Post
    Ext.grid.feature.Grouping doesn't have the 'click' event!
    I think you need groupclick
    You're right.
    I'va tried 'groupclick' and 'groupcollapse' but it doesn't work either.

  5. #4
    Sencha User chramer's Avatar
    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    208
    Vote Rating
    10
    Answers
    42
    chramer will become famous soon enough

      1  

    Default


    it looks like this event is fired on the view
    try this :
    Code:
        view : {
        listeners: {
            'groupclick': function() {
                alert("test");
            }
        }

  6. #5
    Sencha User
    Join Date
    Jan 2010
    Posts
    15
    Vote Rating
    1
    Salah91 is on a distinguished road

      0  

    Default


    No error message this time but the listeners still dont get triggered

  7. #6
    Sencha User chramer's Avatar
    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    208
    Vote Rating
    10
    Answers
    42
    chramer will become famous soon enough

      0  

    Default


    try also to add this as a grid property!
    Code:
            viewConfig : {
                listeners : {
                    'groupclick' : function() {
                        alert('success');
                    }
                }
            }

  8. #7
    Sencha User
    Join Date
    Jan 2010
    Posts
    15
    Vote Rating
    1
    Salah91 is on a distinguished road

      0  

    Default


    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

Thread Participants: 1

Tags for this Thread