Add menu item using client side code

  1. #1

    Add menu item using client side code

    Hello, I'm using the code bellow to add an item to a menu without the need to run a directmethod however I'm not sure how to add a click listener, image and the index to the menu item, when I add it it always goes to the bottom of the menu list.
    Any help is much appreciated.

    Ext.getCmp('mnuComponent').add({text:'test'})
  2. #2
    I found out how to insert always at the top, now I need a click listener and image:

    Ext.getCmp('mnuComponent').insert(0, {text:'test'})
  3. #3
    this code would help if I could get it to run:

    var menuItem = Ext.create('Ext.menu.Item', {
            text: 'menu item'
    });
    throws:

    TypeError: b[e] is not a constructor


    ...;if(a.getMonth()==G.getMonth()&&a.getFullYear() ==G.getFullYear()){this.cells.rem...

Similar Threads

  1. [CLOSED] How to check a menu item on the client?
    By vadym.f in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 02, 2013, 3:46 PM
  2. Replies: 1
    Last Post: May 30, 2011, 11:45 AM
  3. [CLOSED] Server Side Menu Item in bold font
    By nirajrdave in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 25, 2011, 11:54 AM
  4. How to fire server side event for menu item.
    By Satyanarayana murthy in forum 1.x Help
    Replies: 5
    Last Post: Dec 03, 2009, 10:55 AM
  5. Replies: 2
    Last Post: Sep 12, 2008, 10:38 AM

Tags for this Thread

Posting Permissions