1. #1
    Ext User
    Join Date
    Mar 2010
    Posts
    48
    Vote Rating
    0
    mwmcmullen is on a distinguished road

      0  

    Default Can't add Menu to TabItem

    Can't add Menu to TabItem


    Just tried Googling this to which the perfect link came up however it didn't load.

    I'd like to a Menu to the TabItem 'header' section, i.e. the little tab bit that contains the name of the tab in the TabPanel.

    I've tried a simple:

    Code:
    /*
    * Class that extends TabItem
    * Constructor then calls the following method:
    */
    
    final Menu menu = new Menu();
    menu.setWidth(150);
    final MenuItem renameTab = new MenuItem();
    renameTab.setText("Rename Tab");
    renameTab.setIconStyle("expand");
    renameTab.addSelectionListener(new SelectionListener<MenuEvent>()
    {
    	@Override
    	public void componentSelected(MenuEvent ce) 
    	{
    		final Listener<MessageBoxEvent> l = new Listener<MessageBoxEvent>()
    		{
    			@Override
    			public void handleEvent(MessageBoxEvent be) 
    			{
    				if(be.getButtonClicked().getItemId().equals(Dialog.NO))
    				{
    				}
    				else if(be.getButtonClicked().getItemId().equals(Dialog.YES))
    				{
    				}
    			}
    		};
    		MessageBox.confirm("dostuff", "Are you sure?" , l);
    	}
    });
    menu.add(renameTab);
    
    setContextMenu(menu);
    This isn't working. Am I right in assuming this setContextMenu *should* do what I desire?

  2. #2
    Ext User
    Join Date
    Sep 2010
    Posts
    16
    Vote Rating
    0
    hongjiang.zhang is on a distinguished road

      0  

    Default


    I also encountered this issue. Why there is nobody answer it?

  3. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    The header is not part of the TabItem. You need to assign the menu to your TabPanel. Then you also need to add an Events.ContextMenu listener. The listener needs to cancel that event if the target is not the header stripe.

Similar Threads

  1. Adding a 'Right-Click' Menu to a TabItem [source included]
    By mwmcmullen in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 9 Jun 2010, 5:11 AM
  2. Can't add a EditorGrid inside a TabItem on GXT 2.0 M2
    By edumrf in forum Ext GWT: Discussion
    Replies: 9
    Last Post: 10 Jul 2009, 11:30 AM
  3. How to add context menu to HeaderItem of the TabItem?
    By moldoe in forum Ext GWT: Help & Discussion (1.x)
    Replies: 10
    Last Post: 20 Apr 2009, 8:02 AM
  4. How to add a close button on the tabItem title
    By javist in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 4 Nov 2006, 4:22 PM

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar