Results 1 to 4 of 4

Thread: how to iterate through items in menu?

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    33
    Vote Rating
    0
      0  

    Default how to iterate through items in menu?

    Sorry for my newbie question, I'm trying to bind 'contextmenu' event to all menuitems in a menu, please advice how to iterate through each item within that menu?

    Thx

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,438
    Vote Rating
    859
      0  

    Default

    Code:
    menu.items.each(function(item){
        // ...
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    33
    Vote Rating
    0
      0  

    Default

    yes, that's what I want. but there's another problem, as the contextmenu is shown on top of another menu(main menu), when the contextmenu showed the main menu would be automatically closed, how can I prevent the main menu from closing?

    thx again!

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    249
      0  

    Default

    Try adding the config option of hideOnClick: false to the menu item that opens the sub-menu. That should prevent the parent menu from hiding when you click the item with a sub-menu.

Similar Threads

  1. HOWTO ITERATE OVER TEXTFIELD ITEMS IN A TAB
    By rich71 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 21 Jul 2010, 8:57 AM
  2. How to Iterate over Panel items?
    By mtigua in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Mar 2010, 11:40 AM
  3. [SOLVED] how to Iterate over FormPanel Items?
    By rissato in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 3 Jun 2009, 1:32 PM
  4. How to iterate over and change the CSS class of every combo items?
    By truszeka in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 26 Dec 2008, 4:31 PM
  5. Iterate through combo box items
    By Royan in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 6 Dec 2007, 12:18 AM

Posting Permissions

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