TabPanel with ContextMenu

  1. #1

    TabPanel with ContextMenu

    Hi

    I would like to implement a custom context-menu inside a TabPanel. I have some posts about the <contextmenu> listener but it seems that it has now gone on the latest version.

    Can someone perhaps suggest a way of getting a context menu to operate on a TabPanel.

    Thanks in advance!
  2. #2
    Hello!

    You can create own plugin or add handler with custom menu.

    Anyway, investigating how works TabCloseMenu plugin will be useful: http://docs.sencha.com/extjs/4.2.1/#...x.TabCloseMenu
  3. #3
    Thank you for the direction - in case anyone else would like to acheive this....I have read the code and utilised it in the same manner successfully

       init: function (menu) {
            this.tabPanel = App.tabEstimates;
            this.tabBar = this.tabPanel.down('tabbar');
            this.menu = menu;
    
            this.tabPanel.on('afterlayout', this.onAfterLayout, this);
        },
        onAfterLayout: function () {
            this.tabPanel.mon(this.tabBar.el, {
                scope: this,
                contextmenu: this.onContextMenu,
                delegate: 'div.x-tab'
            });
        },
        onContextMenu: function (event, target) {
            this.contextMenuTab = this.tabBar.getChildByElement(target);
            event.preventDefault();
            this.menu.showAt(event.getXY());
        },
  4. #4
    Thank you!

Similar Threads

  1. [CLOSED] Chart ContextMenu
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 05, 2012, 4:08 PM
  2. ContextMenu in Panel
    By Maia in forum 1.x Help
    Replies: 1
    Last Post: Dec 18, 2009, 9:54 AM
  3. ContextMenu
    By Maia in forum 1.x Help
    Replies: 2
    Last Post: Dec 08, 2009, 4:12 PM
  4. TreePanel and ContextMenu
    By rhnkyr in forum 1.x Help
    Replies: 2
    Last Post: Oct 15, 2009, 9:51 AM
  5. ComboBox as ContextMenu?
    By Tbaseflug in forum 1.x Help
    Replies: 7
    Last Post: Oct 13, 2009, 11:50 AM

Posting Permissions