1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default Context menu on grid causes browser's context menu to show

    Context menu on grid causes browser's context menu to show


    Hi,

    I have a coded a menu to be displayed when a user right-clicks on a row within the grid. However both my custom context menu and the browser's (firefox) context menu shows. Is there something simple I am missing to prevent firefox's context menu to show.

    Here is the code I use to handle the right click:

    Code:
    		pagesGrid = new Ext.grid.EditorGrid(
    			'pages-grid', 
    			{	autoSizeColumns: false,
    				ds: dsPages, 
    				cm: colModel, 
    				selModel: new Ext.grid.RowSelectionModel(),
    				listeners:  {
    					'rowcontextmenu' : function(grid, rowIndex, e){
    						var coords = e.getXY();
              	mainContextMenu.showAt([coords[0], coords[1]]);
            	}
    				}				
    			}
    		);

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,537
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    e.stopEvent(), maybe also e.preventDefault()

  3. #3
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default


    thanks, both worked.

    scott.

Thread Participants: 1