1. #1
    Sencha User
    Join Date
    Nov 2009
    Location
    Milton Keynes, England
    Posts
    18
    Vote Rating
    0
    tomearly is on a distinguished road

      0  

    Question ColorMenu as submenu

    ColorMenu as submenu


    Hi,

    I'm using an Ext.menu.ColorMenu as a context menu item on right clicking on a tree.

    Each item within the tree can use this submenu.

    However once i've selected a colour for one item in the tree, the previous colour is still selected in the colour menu and I can't reselect it again, but I can choose a different colour.

    Below is the code that am I using. Is this the correct method, and if so is there a way to deselect the chosen colour in the colour menu?

    PHP Code:
    var colorMenu = new Ext.menu.ColorMenu({
            
    handler: function(cmcolor){
                 
    //my code here
            
    }
    });

           var 
    menu = new Ext.menu.Menu({
            
    id'mainMenu',
            
    style: {
                
    overflow'visible'
            
    },
            
    items: [
               {
                    
    text'Choose a Color',
                    
    iconCls'color-picker-icon-small',
                    
    menucolorMenu
                
    }
            ]
        });

    MenuPanel = function(title,treedata) {
        
    MenuPanel.superclass.constructor.call(this, {
            
    bordertrue,
            
    autoScrolltrue,
            
    tbardeviceToolbar,
            
    animatefalse,
            
    rootVisible:false,
            
    collapseMode:'mini',
            
    collapsed:false,
            
    linestrue,
            
    useArrowstrue,
            
    loader: new Ext.tree.TreeLoader(),
    //        cls: 'menu-tree',
            
    root: new Ext.tree.AsyncTreeNode({
                    
    id:'source'
            
    }),
            
    listeners: {
                    
    contextmenu: function(node,e){
                            var 
    analog = /analog/gi;

                            if(
    node.parentNode.id.match(analog))
                            {
                                    if(
    node.attributes.checked === true)
                                    {
                                            var 
    nodeidArray node.id.split('^');
                                            var 
    graphid nodeidArray[1];
                                            
    selectedContextGID graphid//used in colorMenu function

                                            
    node.select();
                                            
    menu.contextNode node;
                                            
    menu.showAt(e.getXY());
                                    }
                            }
                    }
             }
             })
    }; 

  2. #2
    Sencha User
    Join Date
    Nov 2009
    Location
    Milton Keynes, England
    Posts
    18
    Vote Rating
    0
    tomearly is on a distinguished road

      0  

    Default


    Any ideas on this?

Similar Threads

  1. colorMenu error when using id
    By ValterBorges in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 17 Aug 2009, 5:22 AM
  2. [FIXED][DUP][3.0] ColorMenu et al
    By stever in forum Ext 3.x: Bugs
    Replies: 4
    Last Post: 12 May 2009, 7:21 AM
  3. [FIXED][DUP][3.0] ColorMenu et al
    By stever in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 11 Apr 2009, 12:07 AM

Tags for this Thread