1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    14
    Vote Rating
    0
    MmarcoM is on a distinguished road

      0  

    Default EditableGrid with cellcontextmenu

    EditableGrid with cellcontextmenu


    Hi all
    i had a EditableGrid to which i am trying to add a cellcontextmenu (like you do for TreeNode, which listens to right-click buttons)
    from API, editableGrid extends Grid (which has a cellcontextmenu)_

    however, when i define cellcontextmenu as a listener, i get back

    'Object does not support this property or method'...

    Are there any chances to have contextmenu for an edtiable grid?

    w/kindest regards
    marco

  2. #2
    Ext User
    Join Date
    Apr 2009
    Posts
    37
    Vote Rating
    0
    vladcd is on a distinguished road

      0  

    Default


    I took the example from here: http://www.extjs.com/deploy/dev/exam...rray-grid.html
    and I then changed the type of the grid(instead of GridPanel put EditorGridPanel) and then I added the following configuration option to the existing ones:

    Code:
    listeners : {
                scope : this,
                cellcontextmenu : function(grid, row, column, e){
                    e.preventDefault();
                    if(!this.cellMenu){
                        this.cellMenu = new Ext.menu.Menu({
                            items : [{
                                xtype : 'menuitem', 
                                text: 'First Item'
                            }, '-', {
                                xtype :'menuitem',
                                text: 'Second Item'
                            }]
                        });
                    }
                    this.cellMenu.showAt(e.getXY());
                }
            }
    I only gave it a quick spin on FF3. Hope it helps. If not, you might be doing something else wrong.

Thread Participants: 1