1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    72
    Vote Rating
    5
    elirov is on a distinguished road

      0  

    Default How do you add a SeparatorMenuItem to a menu?

    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 - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      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
    72
    Vote Rating
    5
    elirov is on a distinguished road

      0  

    Default


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

Thread Participants: 1