Results 1 to 7 of 7

Thread: Adding a menu to a div

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    32

    Default Adding a menu to a div

    Is it possible to add a menu object directly to a div and always show it without adding it to a toolbar or button? I would like to add a menu as a navigator and always have the parent menu be shown. I have tried creating a new menu and using the 'el' property to tell it what dom object to attach it to:

    var menu2 = new Ext.menu.Menu({
    id: 'Menu2',
    el: 'xMenu2',
    items: [
    new Ext.menu.CheckItem({
    text: 'I like Ext',
    checked: true,
    checkHandler: onItemCheck
    }),
    new Ext.menu.CheckItem({
    text: 'Ext for jQuery',
    checked: true,
    checkHandler: onItemCheck
    }) ]
    }
    }
    ]
    });

    and then tried using the render() method, but nothing appears. Any advice would be helpful.

  2. #2
    Sencha Premium Member
    Join Date
    Mar 2007
    Posts
    22

    Default

    This is exactly what I am trying to do....

    Tried looking at the source code for menu and I think this should work.

    Or should we be using 'show' or 'showAt' ? I tried them both with no luck.

    Sure would love to ditch this YAHOO menu for the Ext menu

    Thanks

    Eli

  3. #3

    Default

    Is it possible to add a menu object directly to a div and always show it without adding it to a toolbar or button?
    Has this problem solved?

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    You need to use the Ext.ux.Menubar extension which provides "permanent" menus rendered into fixed containers.

    http://extjs.com/learn/Extension:MenuBar

  5. #5

    Default

    animal, thank you for your reply.
    Today I find MenuBar and use it very happy!
    But I find a bug: 'align:right' does not have any effect in IE 6.
    Can you help me?

  6. #6
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,232

    Default

    try
    Code:
    align:right !important;

  7. #7

    Default

    mystix,thank you for your reply, but your code has no effect.

Similar Threads

  1. Button with Menu (menu auto show/hide)
    By fafhrd in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 23 Mar 2007, 12:19 AM
  2. Ext.menu.Menu.items: How to add a handler to existing items?
    By oxi in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 15 Mar 2007, 10:49 PM
  3. Adding a record when xml is empty?
    By franklt69 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 9 Mar 2007, 4:32 AM
  4. I am having a problem in adding YUI - TABS
    By mkundety in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 3 Mar 2007, 11:16 AM
  5. Adding CSS rules through JavaScript, isn't this bad?
    By Skeleton in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 21 Feb 2007, 12:40 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
  •