Results 1 to 3 of 3

Thread: How to loop through the items in Ext.menu.Menu and delete items with a specific prop

  1. #1

    Default How to loop through the items in Ext.menu.Menu and delete items with a specific prop

    I'm using the Ext.menu.Menu to list items and want to loop through them to look for a specific value. Js:
    Code:
    new Ext.Container({                
                  width: 560,
                    height: 250,
                    layout: 'hbox',
                    items: [
                        new Ext.menu.Menu({
                            items: [
                                {
                                    text: 'Today',
                                    handler: function() {
                                    },
                                    scope: this
                                }
                            ].concat([
                                    {
                                        text: 'Yestaerday',
                                        handler: function() {
                                        },
                                        scope: this
                                    }, {
                                        text: 'Month'
                                        handler: function() {
                                        },
                                        scope: this
                                    }
                                ]).concat([
                                    {
                                        text: 'Year',
                                        handler: function() {
                                        },
                                        scope: this
                                    }]
                        })
    in the above code i'm trying to remove the items whose text value is"Yestaerday and Month". How can I loop through the menu items to find the equivalent text value to be removed?thx

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Why put them in there in the first place? Can I ask what the use case is here?

  3. #3

    Default

    This is an existing code in the appln and I dont have much control over the code sturcture. The scenarios is these menu items are concatenated together to form dropdown for a datepicker extended by "twinTriggerField" I want to display only few options for rendering purpose(the options listed in the question).

Similar Threads

  1. ExtJS 4.2.x Menu Items (extra space before menu items)
    By arnoldvillasanta in forum Ext:Bugs
    Replies: 7
    Last Post: 8 Jul 2014, 3:16 PM
  2. menu as toolbar items and context menu items
    By nurhadijogja in forum Ext: Q&A
    Replies: 8
    Last Post: 3 May 2013, 3:45 AM
  3. [MOVED] Please Implement Delete Key to delete items in addition to Delete Menu Item
    By markjlyon in forum Ext Designer: Help & Discussion
    Replies: 1
    Last Post: 11 May 2010, 7:48 AM
  4. Mouse click does not work on menu items(when menu is rendered as context menu)
    By anilcs0405 in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 3 Aug 2009, 5:55 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
  •