The method bellow intends to get a cell reference by the mouse or other element position in page.
It'll return an array with the cell row and col (useful for getting fieldName and record) and the cell element (td) itself.

I need this to create a trigger on every cell to show a menu on an EditorGrid, and RightClick was not an option.

Here's the overrides to add the method to GridView:

PHP Code:
Ext.override(Ext.grid.GridView, {
    
/**
     * Returns a cell row, col, and element, by the xy coodinates
     * 
     * @param {Integer} x
     * @param {Integer} y
     * @returns {Array} [row, col, el]
     */
    
getCellByXY: function(xy) {
        var 
view this,
            
rows view.getRows();
        
        
//loop rows
        
for (var 0rows.lengthi++) {
            var 
0cell;
            
//loop cells in row
            
while (cell view.getCell(ij)) {
                var 
cellEl Ext.get(cell);
                
                if (
cellEl.getTop() <= && cellEl.getBottom() >= y) {
                    if (
cellEl.getLeft() <= && cellEl.getRight() >= x) {
                        return [
ijcell]; 
                    }
                } else {
                    
//prevent useless cell loops in wrong row
                    
break;
                }
                
                
j++;
            }
        }
        
    }
}); 
Usage example:

PHP Code:
//on any element positioned above grid
click: {                                                                                
    
fn: function(evel) {                                                              
        var 
xy   ev.getXY(),                                                          
            
cell this.getView().getCellByXY(xy[0], xy[1]);                            
                                                                                        
        
//console.log(cell);
        //to domething
    
},                                                                                  
    
scopegrid