1. #1
    Sencha User BulletzBill's Avatar
    Join Date
    Mar 2010
    Location
    New York
    Posts
    138
    Vote Rating
    0
    BulletzBill is on a distinguished road

      0  

    Default Getting a toolbar's overflow menu

    Getting a toolbar's overflow menu


    Is there a way to get the Ext.menu and/or the Ext.Button components used for the overflow menu and "more button" respectively on a Ext.toolbar that has enableOverflow:true?

    I tried attaching a listener to the toolbar's 'overflowchange' event to see if I could use query() or getComponent() to find the button/menu when it was being shown, but that event does not seem to fire when resizing the toolbar to cause the overflow menu to appear/disappear. I also monitored the toolbar's 'add' event to see if that was fired when the "more" button was added to the toolbar, but no luck there either.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,206
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The menu is held at toolbar.layout.overflowHanlder.menu
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User BulletzBill's Avatar
    Join Date
    Mar 2010
    Location
    New York
    Posts
    138
    Vote Rating
    0
    BulletzBill is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    The menu is held at toolbar.layout.overflowHanlder.menu
    Thanks, Mitchell. Also, I found the "more" button, its held in toolbar.layout.overflowHandler.menuTrigger, in case anyone was wondering.

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    12
    Vote Rating
    0
    mrjari is on a distinguished road

      0  

    Default


    ...and this is a way to remove the button in the handler of the button itself (that lose the reference if in the overflow menu)

    PHP Code:
    handler: function () {
      
    toolbar[0].remove(this); //this give warning if button is in overflow menu
      
    menuItems toolbar[0].layout.overflowHandler.menuItems;
      for (var 
    0menuItems.lengthx++) {
        if(
    menuItems[x].overflowClone == this) {
          
    toolbar[0].remove(menuItems[x]); //this is the real button reference to remove
          
    break;
        };
      }

    I hope it can save someone some hour of code digging...

Thread Participants: 2