1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    75
    Vote Rating
    0
    saravanakmr is on a distinguished road

      0  

    Default context menu in combo box

    context menu in combo box


    Hi
    Is this possible to get context menu in combo box ?

    if possible suggest answer..


    Thanks

  2. #2
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    397
    Vote Rating
    17
    Zdeno will become famous soon enough

      0  

    Default


    Aye it is possible. Combobox render items to Ext.view.BoundList as you can see in source code. When you can look in docs you will see following function:

    Code:
    itemcontextmenu( Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e, Object eOpts)
    So override Combobox and add this listener to picker.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    75
    Vote Rating
    0
    saravanakmr is on a distinguished road

      0  

    Default


    Thanks

    can you give simple implementation example?

  4. #4
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    397
    Vote Rating
    17
    Zdeno will become famous soon enough

      1  

    Default


    Ehm there is simpler solution. I apologize. Here is part of combobox configuration.

    http://docs.sencha.com/ext-js/4-1/#!...cfg-listConfig

    Code:
    ...
    listConfig: {
        listeners: {
            itemcontextmenu: function(list, ecord, item, index, e, eOpts) {
                e.preventDefault();
                contextmenu.showAt(e.getXY())
            }
        }
    }
    ...

Thread Participants: 1