Results 1 to 3 of 3

Thread: ToolBar Button onClick override not invoked when Button is in ToolBar overflow menu

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Vote Rating

    Default ToolBar Button onClick override not invoked when Button is in ToolBar overflow menu

    I deleted my original post after doing some more research into this issue. The Overflow menu that gets added to the ToolBar seems to contain MenuItems instead of Buttons. I came across the following thread in the EXT JS Bug forums which lead me to this info. I am not entirely sure how I should handle this. I created a Widget that extends ToggleButton and overrides the onClick(Event event) method. Everything works great until the Overflow menu gets created.
    Attached Images Attached Images

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Vote Rating


    Thank you for bringing this issue to our attention.

    When the number of items on the ToolBar exceeds the number that can be displayed, the ToolBar creates a menu and moves the the items that overflow to the new menu. At this point the ToggleButton's onClick method is no longer invoked. We are reviewing this issue internally to determine the best way to handle this situation.

    In the interim, you can work around the problem by using a SelectHandler instead of an onClick override. Add the SelectHandler to the ToggleButton and move the logic from your onClick override to the onSelect method of the select handler.
        addSelectHandler(new SelectHandler() {
          public void onSelect(SelectEvent event) {
            // logic from onClick override

  3. #3
    Sencha User darrellmeyer's Avatar
    Join Date
    May 2007
    Washington, DC
    Vote Rating


    Using a SelectHandler on the button is the correct way to have code executed when the button is clicked and when the overflow mene item is clicked.

    The overflow translates buttons to menu items and uses the SelectHandler from the button with the mene item. The button onClick method will not be called when the button is part of the overflow menu.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts