Results 1 to 3 of 3

Thread: How do you add a SeparatorMenuItem to a menu?

  1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    73
    Vote Rating
    5
      0  

    Default How do you add a SeparatorMenuItem to a menu?

    I'm trying to add a SeparatorMenuItem to a menu, but since it inherits from Item instead of MenuItem, I get a class cast exception during runtime. In the example, it looks like it should just work. Am I doing something wrong?

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Vote Rating
    93
      0  

    Default

    Without seeing some sample code, it is hard to say what is wrong - can you post a sample of what you are trying to do so that we can easily reproduce this?

    It seems to work in the example at http://www.sencha.com/examples-dev/#...ePlace:menubar :

    Code:
        //...
        menu = new Menu();
        menu.addSelectionHandler(handler);
    
     
        CheckMenuItem menuItem = new CheckMenuItem("I Like Cats");
        menuItem.setChecked(true);
        menu.add(menuItem);
     
        menuItem = new CheckMenuItem("I Like Dogs");
        menu.add(menuItem);
     
     
        menu.add(new SeparatorMenuItem());
    
     
        MenuItem radios = new MenuItem("Radio Options");
    
        menu.add(radios);
        //...

  3. #3
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    73
    Vote Rating
    5
      0  

    Default

    Oops.. I was casting in my own code. Sorry about that... It works fine.

Posting Permissions

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