1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    372
    Vote Rating
    3
    ttbgwt is on a distinguished road

      0  

    Default Unanswered: How to get cell index (or dataIndex) of the cell that triggered itemcontextmenu ?

    Unanswered: How to get cell index (or dataIndex) of the cell that triggered itemcontextmenu ?


    How can I get the cell index (or dataIndex) of the cell that triggered this itemcontextmenu of a grid view?

    Code:
      listeners: {
        itemcontextmenu: function (view, record, el, index, e, eOpts) {
            e.preventDefault();
            //how can I get the cell index (or dataIndex) of the cell that triggered this itemcontextmenu?
        }
       }

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,868
    Answers
    652
    Vote Rating
    438
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have a look at:

    Code:
    var pos  = grid.getSelectionModel().getCurrentPosition();
    console.log(pos);
    Scott.

  3. #3
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    372
    Vote Rating
    3
    ttbgwt is on a distinguished road

      0  

    Default


    I landed up listening to the cellcontextmenu event on the grid's view...

    Code:
                viewConfig: {
                    listeners: {
                        cellcontextmenu: function (view, cell, cellIndex, record, row, rowIndex, e) {
    
    
                            e.preventDefault();
    
    
                            var column = view.getHeaderByCell(cell);
                            var position = view.getPositionByEvent(e);
                            var columnIndex = position.column;
                            var dataIndex = column.dataIndex;

Thread Participants: 1