Upgrade to ExtJS 3.3.1 - Released 11/30/2010
[extjs.git] / pkgs / pkg-menu-debug.js
index 58187ee..b8401cb 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * Ext JS Library 3.1.1
- * Copyright(c) 2006-2010 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
  */
 /**
  * @class Ext.menu.Menu
@@ -294,7 +294,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
         var items = this.items;
         for(var i = start, len = items.length; i >= 0 && i < len; i+= step){
             var item = items.get(i);
-            if(!item.disabled && (item.canActivate || item.isFormField)){
+            if(item.isVisible() && !item.disabled && (item.canActivate || item.isFormField)){
                 this.setActiveItem(item, false);
                 return item;
             }
@@ -433,6 +433,10 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
         }else{
             max = this.getHeight();
         }
+        // Always respect maxHeight 
+        if (this.maxHeight){
+            max = Math.min(this.maxHeight, max);
+        }
         if(full > max && max > 0){
             this.activeMax = max - this.scrollerHeight * 2 - this.el.getFrameWidth('tb') - Ext.num(this.el.shadowOffset, 0);
             this.ul.setHeight(this.activeMax);
@@ -545,8 +549,8 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
          return c;
     },
 
-    applyDefaults : function(c){
-        if(!Ext.isString(c)){
+    applyDefaults : function(c) {
+        if (!Ext.isString(c)) {
             c = Ext.menu.Menu.superclass.applyDefaults.call(this, c);
             var d = this.internalDefaults;
             if(d){
@@ -562,10 +566,10 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
     },
 
     // private
-    getMenuItem : function(config){
-       if(!config.isXType){
-            if(!config.xtype && Ext.isBoolean(config.checked)){
-                return new Ext.menu.CheckItem(config)
+    getMenuItem : function(config) {
+        if (!config.isXType) {
+            if (!config.xtype && Ext.isBoolean(config.checked)) {
+                return new Ext.menu.CheckItem(config);
             }
             return Ext.create(config, this.defaultType);
         }
@@ -576,7 +580,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
      * Adds a separator bar to the menu
      * @return {Ext.menu.Item} The menu item that was added
      */
-    addSeparator : function(){
+    addSeparator : function() {
         return this.add(new Ext.menu.Separator());
     },
 
@@ -585,7 +589,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
      * @param {Mixed} el The element or DOM node to add, or its id
      * @return {Ext.menu.Item} The menu item that was added
      */
-    addElement : function(el){
+    addElement : function(el) {
         return this.add(new Ext.menu.BaseItem({
             el: el
         }));
@@ -596,7 +600,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
      * @param {Ext.menu.Item} item The menu item to add
      * @return {Ext.menu.Item} The menu item that was added
      */
-    addItem : function(item){
+    addItem : function(item) {
         return this.add(item);
     },
 
@@ -605,7 +609,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
      * @param {Object} config A MenuItem config object
      * @return {Ext.menu.Item} The menu item that was added
      */
-    addMenuItem : function(config){
+    addMenuItem : function(config) {
         return this.add(this.getMenuItem(config));
     },
 
@@ -797,18 +801,6 @@ Ext.menu.MenuMgr = function(){
        }
    }
 
-   // private
-   function onBeforeCheck(mi, state){
-       if(state){
-           var g = groups[mi.group];
-           for(var i = 0, l = g.length; i < l; i++){
-               if(g[i] != mi){
-                   g[i].setChecked(false);
-               }
-           }
-       }
-   }
-
    return {
 
        /**
@@ -871,7 +863,6 @@ Ext.menu.MenuMgr = function(){
                    groups[g] = [];
                }
                groups[g].push(menuItem);
-               menuItem.on("beforecheckchange", onBeforeCheck);
            }
        },
 
@@ -880,7 +871,23 @@ Ext.menu.MenuMgr = function(){
            var g = menuItem.group;
            if(g){
                groups[g].remove(menuItem);
-               menuItem.un("beforecheckchange", onBeforeCheck);
+           }
+       },
+       
+       // private
+       onCheckChange: function(item, state){
+           if(item.group && state){
+               var group = groups[item.group],
+                   i = 0,
+                   len = group.length,
+                   current;
+                   
+               for(; i < len; i++){
+                   current = group[i];
+                   if(current != item){
+                       current.setChecked(false);
+                   }
+               }
            }
        },
 
@@ -950,7 +957,7 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, {
      */
     hideOnClick : true,
     /**
-     * @cfg {Number} clickHideDelay Length of time in milliseconds to wait before hiding after a click (defaults to 100)
+     * @cfg {Number} clickHideDelay Length of time in milliseconds to wait before hiding after a click (defaults to 1)
      */
     clickHideDelay : 1,
 
@@ -959,33 +966,33 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, {
 
     // private
     actionMode : "container",
-    
+
     initComponent : function(){
         Ext.menu.BaseItem.superclass.initComponent.call(this);
         this.addEvents(
-               /**
-                * @event click
-                * Fires when this item is clicked
-                * @param {Ext.menu.BaseItem} this
-                * @param {Ext.EventObject} e
-                */
-               'click',
-               /**
-                * @event activate
-                * Fires when this item is activated
-                * @param {Ext.menu.BaseItem} this
-                */
-               'activate',
-               /**
-                * @event deactivate
-                * Fires when this item is deactivated
-                * @param {Ext.menu.BaseItem} this
-                */
-               'deactivate'
-           );
-           if(this.handler){
-               this.on("click", this.handler, this.scope);
-           }
+            /**
+             * @event click
+             * Fires when this item is clicked
+             * @param {Ext.menu.BaseItem} this
+             * @param {Ext.EventObject} e
+             */
+            'click',
+            /**
+             * @event activate
+             * Fires when this item is activated
+             * @param {Ext.menu.BaseItem} this
+             */
+            'activate',
+            /**
+             * @event deactivate
+             * Fires when this item is deactivated
+             * @param {Ext.menu.BaseItem} this
+             */
+            'deactivate'
+        );
+        if(this.handler){
+            this.on("click", this.handler, this.scope);
+        }
     },
 
     // private
@@ -1091,15 +1098,17 @@ Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, {
      */
     itemCls : "x-menu-text",
     
-    constructor : function(config){
-        if(typeof config == 'string'){
-            config = {text: config}
+    constructor : function(config) {
+        if (typeof config == 'string') {
+            config = {
+                text: config
+            };
         }
         Ext.menu.TextItem.superclass.constructor.call(this, config);
     },
 
     // private
-    onRender : function(){
+    onRender : function() {
         var s = document.createElement("span");
         s.className = this.itemCls;
         s.innerHTML = this.text;
@@ -1142,216 +1151,223 @@ Ext.menu.Separator = Ext.extend(Ext.menu.BaseItem, {
         Ext.menu.Separator.superclass.onRender.apply(this, arguments);
     }
 });
-Ext.reg('menuseparator', Ext.menu.Separator);/**\r
- * @class Ext.menu.Item\r
- * @extends Ext.menu.BaseItem\r
- * A base class for all menu items that require menu-related functionality (like sub-menus) and are not static\r
- * display items.  Item extends the base functionality of {@link Ext.menu.BaseItem} by adding menu-specific\r
- * activation and click handling.\r
- * @constructor\r
- * Creates a new Item\r
- * @param {Object} config Configuration options\r
- * @xtype menuitem\r
- */\r
-Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {\r
-    /**\r
-     * @property menu\r
-     * @type Ext.menu.Menu\r
-     * The submenu associated with this Item if one was configured.\r
-     */\r
-    /**\r
-     * @cfg {Mixed} menu (optional) Either an instance of {@link Ext.menu.Menu} or the config object for an\r
-     * {@link Ext.menu.Menu} which acts as the submenu when this item is activated.\r
-     */\r
-    /**\r
-     * @cfg {String} icon The path to an icon to display in this item (defaults to Ext.BLANK_IMAGE_URL).  If\r
-     * icon is specified {@link #iconCls} should not be.\r
-     */\r
-    /**\r
-     * @cfg {String} iconCls A CSS class that specifies a background image that will be used as the icon for\r
-     * this item (defaults to '').  If iconCls is specified {@link #icon} should not be.\r
-     */\r
-    /**\r
-     * @cfg {String} text The text to display in this item (defaults to '').\r
-     */\r
-    /**\r
-     * @cfg {String} href The href attribute to use for the underlying anchor link (defaults to '#').\r
-     */\r
-    /**\r
-     * @cfg {String} hrefTarget The target attribute to use for the underlying anchor link (defaults to '').\r
-     */\r
-    /**\r
-     * @cfg {String} itemCls The default CSS class to use for menu items (defaults to 'x-menu-item')\r
-     */\r
-    itemCls : 'x-menu-item',\r
-    /**\r
-     * @cfg {Boolean} canActivate True if this item can be visually activated (defaults to true)\r
-     */\r
-    canActivate : true,\r
-    /**\r
-     * @cfg {Number} showDelay Length of time in milliseconds to wait before showing this item (defaults to 200)\r
-     */\r
-    showDelay: 200,\r
-    // doc'd in BaseItem\r
-    hideDelay: 200,\r
-\r
-    // private\r
-    ctype: 'Ext.menu.Item',\r
-\r
-    initComponent : function(){\r
-        Ext.menu.Item.superclass.initComponent.call(this);\r
-        if(this.menu){\r
-            this.menu = Ext.menu.MenuMgr.get(this.menu);\r
-            this.menu.ownerCt = this;\r
-        }\r
-    },\r
-\r
-    // private\r
-    onRender : function(container, position){\r
-        if (!this.itemTpl) {\r
-            this.itemTpl = Ext.menu.Item.prototype.itemTpl = new Ext.XTemplate(\r
-                '<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"',\r
-                    '<tpl if="hrefTarget">',\r
-                        ' target="{hrefTarget}"',\r
-                    '</tpl>',\r
-                 '>',\r
-                     '<img src="{icon}" class="x-menu-item-icon {iconCls}"/>',\r
-                     '<span class="x-menu-item-text">{text}</span>',\r
-                 '</a>'\r
-             );\r
-        }\r
-        var a = this.getTemplateArgs();\r
-        this.el = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(container, a, true);\r
-        this.iconEl = this.el.child('img.x-menu-item-icon');\r
-        this.textEl = this.el.child('.x-menu-item-text');\r
-        if(!this.href) { // if no link defined, prevent the default anchor event\r
-            this.mon(this.el, 'click', Ext.emptyFn, null, { preventDefault: true });\r
-        }\r
-        Ext.menu.Item.superclass.onRender.call(this, container, position);\r
-    },\r
-\r
-    getTemplateArgs: function() {\r
-        return {\r
-            id: this.id,\r
-            cls: this.itemCls + (this.menu ?  ' x-menu-item-arrow' : '') + (this.cls ?  ' ' + this.cls : ''),\r
-            href: this.href || '#',\r
-            hrefTarget: this.hrefTarget,\r
-            icon: this.icon || Ext.BLANK_IMAGE_URL,\r
-            iconCls: this.iconCls || '',\r
-            text: this.itemText||this.text||'&#160;'\r
-        };\r
-    },\r
-\r
-    /**\r
-     * Sets the text to display in this menu item\r
-     * @param {String} text The text to display\r
-     */\r
-    setText : function(text){\r
-        this.text = text||'&#160;';\r
-        if(this.rendered){\r
-            this.textEl.update(this.text);\r
-            this.parentMenu.layout.doAutoSize();\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Sets the CSS class to apply to the item's icon element\r
-     * @param {String} cls The CSS class to apply\r
-     */\r
-    setIconClass : function(cls){\r
-        var oldCls = this.iconCls;\r
-        this.iconCls = cls;\r
-        if(this.rendered){\r
-            this.iconEl.replaceClass(oldCls, this.iconCls);\r
-        }\r
-    },\r
-\r
-    //private\r
-    beforeDestroy: function(){\r
-        if (this.menu){\r
-            delete this.menu.ownerCt;\r
-            this.menu.destroy();\r
-        }\r
-        Ext.menu.Item.superclass.beforeDestroy.call(this);\r
-    },\r
-\r
-    // private\r
-    handleClick : function(e){\r
-        if(!this.href){ // if no link defined, stop the event automatically\r
-            e.stopEvent();\r
-        }\r
-        Ext.menu.Item.superclass.handleClick.apply(this, arguments);\r
-    },\r
-\r
-    // private\r
-    activate : function(autoExpand){\r
-        if(Ext.menu.Item.superclass.activate.apply(this, arguments)){\r
-            this.focus();\r
-            if(autoExpand){\r
-                this.expandMenu();\r
-            }\r
-        }\r
-        return true;\r
-    },\r
-\r
-    // private\r
-    shouldDeactivate : function(e){\r
-        if(Ext.menu.Item.superclass.shouldDeactivate.call(this, e)){\r
-            if(this.menu && this.menu.isVisible()){\r
-                return !this.menu.getEl().getRegion().contains(e.getPoint());\r
-            }\r
-            return true;\r
-        }\r
-        return false;\r
-    },\r
-\r
-    // private\r
-    deactivate : function(){\r
-        Ext.menu.Item.superclass.deactivate.apply(this, arguments);\r
-        this.hideMenu();\r
-    },\r
-\r
-    // private\r
-    expandMenu : function(autoActivate){\r
-        if(!this.disabled && this.menu){\r
-            clearTimeout(this.hideTimer);\r
-            delete this.hideTimer;\r
-            if(!this.menu.isVisible() && !this.showTimer){\r
-                this.showTimer = this.deferExpand.defer(this.showDelay, this, [autoActivate]);\r
-            }else if (this.menu.isVisible() && autoActivate){\r
-                this.menu.tryActivate(0, 1);\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    deferExpand : function(autoActivate){\r
-        delete this.showTimer;\r
-        this.menu.show(this.container, this.parentMenu.subMenuAlign || 'tl-tr?', this.parentMenu);\r
-        if(autoActivate){\r
-            this.menu.tryActivate(0, 1);\r
-        }\r
-    },\r
-\r
-    // private\r
-    hideMenu : function(){\r
-        clearTimeout(this.showTimer);\r
-        delete this.showTimer;\r
-        if(!this.hideTimer && this.menu && this.menu.isVisible()){\r
-            this.hideTimer = this.deferHide.defer(this.hideDelay, this);\r
-        }\r
-    },\r
-\r
-    // private\r
-    deferHide : function(){\r
-        delete this.hideTimer;\r
-        if(this.menu.over){\r
-            this.parentMenu.setActiveItem(this, false);\r
-        }else{\r
-            this.menu.hide();\r
-        }\r
-    }\r
-});\r
+Ext.reg('menuseparator', Ext.menu.Separator);/**
+ * @class Ext.menu.Item
+ * @extends Ext.menu.BaseItem
+ * A base class for all menu items that require menu-related functionality (like sub-menus) and are not static
+ * display items.  Item extends the base functionality of {@link Ext.menu.BaseItem} by adding menu-specific
+ * activation and click handling.
+ * @constructor
+ * Creates a new Item
+ * @param {Object} config Configuration options
+ * @xtype menuitem
+ */
+Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
+    /**
+     * @property menu
+     * @type Ext.menu.Menu
+     * The submenu associated with this Item if one was configured.
+     */
+    /**
+     * @cfg {Mixed} menu (optional) Either an instance of {@link Ext.menu.Menu} or the config object for an
+     * {@link Ext.menu.Menu} which acts as the submenu when this item is activated.
+     */
+    /**
+     * @cfg {String} icon The path to an icon to display in this item (defaults to Ext.BLANK_IMAGE_URL).  If
+     * icon is specified {@link #iconCls} should not be.
+     */
+    /**
+     * @cfg {String} iconCls A CSS class that specifies a background image that will be used as the icon for
+     * this item (defaults to '').  If iconCls is specified {@link #icon} should not be.
+     */
+    /**
+     * @cfg {String} text The text to display in this item (defaults to '').
+     */
+    /**
+     * @cfg {String} href The href attribute to use for the underlying anchor link (defaults to '#').
+     */
+    /**
+     * @cfg {String} hrefTarget The target attribute to use for the underlying anchor link (defaults to '').
+     */
+    /**
+     * @cfg {String} itemCls The default CSS class to use for menu items (defaults to 'x-menu-item')
+     */
+    itemCls : 'x-menu-item',
+    /**
+     * @cfg {Boolean} canActivate True if this item can be visually activated (defaults to true)
+     */
+    canActivate : true,
+    /**
+     * @cfg {Number} showDelay Length of time in milliseconds to wait before showing this item (defaults to 200)
+     */
+    showDelay: 200,
+    
+    /**
+     * @cfg {String} altText The altText to use for the icon, if it exists. Defaults to <tt>''</tt>.
+     */
+    altText: '',
+    
+    // doc'd in BaseItem
+    hideDelay: 200,
+
+    // private
+    ctype: 'Ext.menu.Item',
+
+    initComponent : function(){
+        Ext.menu.Item.superclass.initComponent.call(this);
+        if(this.menu){
+            this.menu = Ext.menu.MenuMgr.get(this.menu);
+            this.menu.ownerCt = this;
+        }
+    },
+
+    // private
+    onRender : function(container, position){
+        if (!this.itemTpl) {
+            this.itemTpl = Ext.menu.Item.prototype.itemTpl = new Ext.XTemplate(
+                '<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"',
+                    '<tpl if="hrefTarget">',
+                        ' target="{hrefTarget}"',
+                    '</tpl>',
+                 '>',
+                     '<img alt="{altText}" src="{icon}" class="x-menu-item-icon {iconCls}"/>',
+                     '<span class="x-menu-item-text">{text}</span>',
+                 '</a>'
+             );
+        }
+        var a = this.getTemplateArgs();
+        this.el = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(container, a, true);
+        this.iconEl = this.el.child('img.x-menu-item-icon');
+        this.textEl = this.el.child('.x-menu-item-text');
+        if(!this.href) { // if no link defined, prevent the default anchor event
+            this.mon(this.el, 'click', Ext.emptyFn, null, { preventDefault: true });
+        }
+        Ext.menu.Item.superclass.onRender.call(this, container, position);
+    },
+
+    getTemplateArgs: function() {
+        return {
+            id: this.id,
+            cls: this.itemCls + (this.menu ?  ' x-menu-item-arrow' : '') + (this.cls ?  ' ' + this.cls : ''),
+            href: this.href || '#',
+            hrefTarget: this.hrefTarget,
+            icon: this.icon || Ext.BLANK_IMAGE_URL,
+            iconCls: this.iconCls || '',
+            text: this.itemText||this.text||'&#160;',
+            altText: this.altText || ''
+        };
+    },
+
+    /**
+     * Sets the text to display in this menu item
+     * @param {String} text The text to display
+     */
+    setText : function(text){
+        this.text = text||'&#160;';
+        if(this.rendered){
+            this.textEl.update(this.text);
+            this.parentMenu.layout.doAutoSize();
+        }
+    },
+
+    /**
+     * Sets the CSS class to apply to the item's icon element
+     * @param {String} cls The CSS class to apply
+     */
+    setIconClass : function(cls){
+        var oldCls = this.iconCls;
+        this.iconCls = cls;
+        if(this.rendered){
+            this.iconEl.replaceClass(oldCls, this.iconCls);
+        }
+    },
+
+    //private
+    beforeDestroy: function(){
+        if (this.menu){
+            delete this.menu.ownerCt;
+            this.menu.destroy();
+        }
+        Ext.menu.Item.superclass.beforeDestroy.call(this);
+    },
+
+    // private
+    handleClick : function(e){
+        if(!this.href){ // if no link defined, stop the event automatically
+            e.stopEvent();
+        }
+        Ext.menu.Item.superclass.handleClick.apply(this, arguments);
+    },
+
+    // private
+    activate : function(autoExpand){
+        if(Ext.menu.Item.superclass.activate.apply(this, arguments)){
+            this.focus();
+            if(autoExpand){
+                this.expandMenu();
+            }
+        }
+        return true;
+    },
+
+    // private
+    shouldDeactivate : function(e){
+        if(Ext.menu.Item.superclass.shouldDeactivate.call(this, e)){
+            if(this.menu && this.menu.isVisible()){
+                return !this.menu.getEl().getRegion().contains(e.getPoint());
+            }
+            return true;
+        }
+        return false;
+    },
+
+    // private
+    deactivate : function(){
+        Ext.menu.Item.superclass.deactivate.apply(this, arguments);
+        this.hideMenu();
+    },
+
+    // private
+    expandMenu : function(autoActivate){
+        if(!this.disabled && this.menu){
+            clearTimeout(this.hideTimer);
+            delete this.hideTimer;
+            if(!this.menu.isVisible() && !this.showTimer){
+                this.showTimer = this.deferExpand.defer(this.showDelay, this, [autoActivate]);
+            }else if (this.menu.isVisible() && autoActivate){
+                this.menu.tryActivate(0, 1);
+            }
+        }
+    },
+
+    // private
+    deferExpand : function(autoActivate){
+        delete this.showTimer;
+        this.menu.show(this.container, this.parentMenu.subMenuAlign || 'tl-tr?', this.parentMenu);
+        if(autoActivate){
+            this.menu.tryActivate(0, 1);
+        }
+    },
+
+    // private
+    hideMenu : function(){
+        clearTimeout(this.showTimer);
+        delete this.showTimer;
+        if(!this.hideTimer && this.menu && this.menu.isVisible()){
+            this.hideTimer = this.deferHide.defer(this.hideDelay, this);
+        }
+    },
+
+    // private
+    deferHide : function(){
+        delete this.hideTimer;
+        if(this.menu.over){
+            this.parentMenu.setActiveItem(this, false);
+        }else{
+            this.menu.hide();
+        }
+    }
+});
 Ext.reg('menuitem', Ext.menu.Item);/**
  * @class Ext.menu.CheckItem
  * @extends Ext.menu.Item
@@ -1378,7 +1394,7 @@ Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
 
     /**
      * @cfg {Boolean} checked True to initialize this checkbox as checked (defaults to false).  Note that
-     * if this checkbox is part of a radio group (group = true) only the last item in the group that is
+     * if this checkbox is part of a radio group (group = true) only the first item in the group that is
      * initialized with checked = true will be rendered as checked.
      */
     checked: false,
@@ -1443,6 +1459,7 @@ Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
     setChecked : function(state, suppressEvent){
         var suppress = suppressEvent === true;
         if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){
+            Ext.menu.MenuMgr.onCheckChange(this, state);
             if(this.container){
                 this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
             }
@@ -1461,224 +1478,224 @@ Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
        Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments);
     }
 });
-Ext.reg('menucheckitem', Ext.menu.CheckItem);/**\r
- * @class Ext.menu.DateMenu\r
- * @extends Ext.menu.Menu\r
- * <p>A menu containing an {@link Ext.DatePicker} Component.</p>\r
- * <p>Notes:</p><div class="mdetail-params"><ul>\r
- * <li>Although not listed here, the <b>constructor</b> for this class\r
- * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>\r
- * <li>If subclassing DateMenu, any configuration options for the DatePicker must be\r
- * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.\r
- * Applying {@link Ext.DatePicker DatePicker} configuration settings to\r
- * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>\r
- * </ul></div>\r
- * @xtype datemenu\r
- */\r
- Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {\r
-    /** \r
-     * @cfg {Boolean} enableScrolling\r
-     * @hide \r
-     */\r
-    enableScrolling : false,\r
-    /**\r
-     * @cfg {Function} handler\r
-     * Optional. A function that will handle the select event of this menu.\r
-     * The handler is passed the following parameters:<div class="mdetail-params"><ul>\r
-     * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>\r
-     * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>\r
-     * </ul></div>\r
-     */\r
-    /**\r
-     * @cfg {Object} scope\r
-     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>\r
-     * function will be called.  Defaults to this DateMenu instance.\r
-     */    \r
-    /** \r
-     * @cfg {Boolean} hideOnClick\r
-     * False to continue showing the menu after a date is selected, defaults to true.\r
-     */\r
-    hideOnClick : true,\r
-    \r
-    /** \r
-     * @cfg {String} pickerId\r
-     * An id to assign to the underlying date picker. Defaults to <tt>null</tt>.\r
-     */\r
-    pickerId : null,\r
-    \r
-    /** \r
-     * @cfg {Number} maxHeight\r
-     * @hide \r
-     */\r
-    /** \r
-     * @cfg {Number} scrollIncrement\r
-     * @hide \r
-     */\r
-    /**\r
-     * The {@link Ext.DatePicker} instance for this DateMenu\r
-     * @property picker\r
-     * @type DatePicker\r
-     */\r
-    cls : 'x-date-menu',\r
-    \r
-    /**\r
-     * @event click\r
-     * @hide\r
-     */\r
-    \r
-    /**\r
-     * @event itemclick\r
-     * @hide\r
-     */\r
-\r
-    initComponent : function(){\r
-        this.on('beforeshow', this.onBeforeShow, this);\r
-        if(this.strict = (Ext.isIE7 && Ext.isStrict)){\r
-            this.on('show', this.onShow, this, {single: true, delay: 20});\r
-        }\r
-        Ext.apply(this, {\r
-            plain: true,\r
-            showSeparator: false,\r
-            items: this.picker = new Ext.DatePicker(Ext.applyIf({\r
-                internalRender: this.strict || !Ext.isIE,\r
-                ctCls: 'x-menu-date-item',\r
-                id: this.pickerId\r
-            }, this.initialConfig))\r
-        });\r
-        this.picker.purgeListeners();\r
-        Ext.menu.DateMenu.superclass.initComponent.call(this);\r
-        /**\r
-         * @event select\r
-         * Fires when a date is selected from the {@link #picker Ext.DatePicker}\r
-         * @param {DatePicker} picker The {@link #picker Ext.DatePicker}\r
-         * @param {Date} date The selected date\r
-         */\r
-        this.relayEvents(this.picker, ['select']);\r
-        this.on('show', this.picker.focus, this.picker);\r
-        this.on('select', this.menuHide, this);\r
-        if(this.handler){\r
-            this.on('select', this.handler, this.scope || this);\r
-        }\r
-    },\r
-\r
-    menuHide : function() {\r
-        if(this.hideOnClick){\r
-            this.hide(true);\r
-        }\r
-    },\r
-\r
-    onBeforeShow : function(){\r
-        if(this.picker){\r
-            this.picker.hideMonthPicker(true);\r
-        }\r
-    },\r
-\r
-    onShow : function(){\r
-        var el = this.picker.getEl();\r
-        el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode\r
-    }\r
- });\r
- Ext.reg('datemenu', Ext.menu.DateMenu);\r
- /**\r
- * @class Ext.menu.ColorMenu\r
- * @extends Ext.menu.Menu\r
- * <p>A menu containing a {@link Ext.ColorPalette} Component.</p>\r
- * <p>Notes:</p><div class="mdetail-params"><ul>\r
- * <li>Although not listed here, the <b>constructor</b> for this class\r
- * accepts all of the configuration options of <b>{@link Ext.ColorPalette}</b>.</li>\r
- * <li>If subclassing ColorMenu, any configuration options for the ColorPalette must be\r
- * applied to the <tt><b>initialConfig</b></tt> property of the ColorMenu.\r
- * Applying {@link Ext.ColorPalette ColorPalette} configuration settings to\r
- * <b><tt>this</tt></b> will <b>not</b> affect the ColorPalette's configuration.</li>\r
- * </ul></div> * \r
- * @xtype colormenu\r
- */\r
- Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {\r
-    /** \r
-     * @cfg {Boolean} enableScrolling\r
-     * @hide \r
-     */\r
-    enableScrolling : false,\r
-    /**\r
-     * @cfg {Function} handler\r
-     * Optional. A function that will handle the select event of this menu.\r
-     * The handler is passed the following parameters:<div class="mdetail-params"><ul>\r
-     * <li><code>palette</code> : ColorPalette<div class="sub-desc">The {@link #palette Ext.ColorPalette}.</div></li>\r
-     * <li><code>color</code> : String<div class="sub-desc">The 6-digit color hex code (without the # symbol).</div></li>\r
-     * </ul></div>\r
-     */\r
-    /**\r
-     * @cfg {Object} scope\r
-     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>\r
-     * function will be called.  Defaults to this ColorMenu instance.\r
-     */    \r
-    \r
-    /** \r
-     * @cfg {Boolean} hideOnClick\r
-     * False to continue showing the menu after a color is selected, defaults to true.\r
-     */\r
-    hideOnClick : true,\r
-    \r
-    cls : 'x-color-menu',\r
-    \r
-    /** \r
-     * @cfg {String} paletteId\r
-     * An id to assign to the underlying color palette. Defaults to <tt>null</tt>.\r
-     */\r
-    paletteId : null,\r
-    \r
-    /** \r
-     * @cfg {Number} maxHeight\r
-     * @hide \r
-     */\r
-    /** \r
-     * @cfg {Number} scrollIncrement\r
-     * @hide \r
-     */\r
-    /**\r
-     * @property palette\r
-     * @type ColorPalette\r
-     * The {@link Ext.ColorPalette} instance for this ColorMenu\r
-     */\r
-    \r
-    \r
-    /**\r
-     * @event click\r
-     * @hide\r
-     */\r
-    \r
-    /**\r
-     * @event itemclick\r
-     * @hide\r
-     */\r
-    \r
-    initComponent : function(){\r
-        Ext.apply(this, {\r
-            plain: true,\r
-            showSeparator: false,\r
-            items: this.palette = new Ext.ColorPalette(Ext.applyIf({\r
-                id: this.paletteId\r
-            }, this.initialConfig))\r
-        });\r
-        this.palette.purgeListeners();\r
-        Ext.menu.ColorMenu.superclass.initComponent.call(this);\r
-        /**\r
-         * @event select\r
-         * Fires when a color is selected from the {@link #palette Ext.ColorPalette}\r
-         * @param {Ext.ColorPalette} palette The {@link #palette Ext.ColorPalette}\r
-            * @param {String} color The 6-digit color hex code (without the # symbol)\r
-         */\r
-        this.relayEvents(this.palette, ['select']);\r
-        this.on('select', this.menuHide, this);\r
-        if(this.handler){\r
-            this.on('select', this.handler, this.scope || this);\r
-        }\r
-    },\r
-\r
-    menuHide : function(){\r
-        if(this.hideOnClick){\r
-            this.hide(true);\r
-        }\r
-    }\r
-});\r
-Ext.reg('colormenu', Ext.menu.ColorMenu);\r
+Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
+ * @class Ext.menu.DateMenu
+ * @extends Ext.menu.Menu
+ * <p>A menu containing an {@link Ext.DatePicker} Component.</p>
+ * <p>Notes:</p><div class="mdetail-params"><ul>
+ * <li>Although not listed here, the <b>constructor</b> for this class
+ * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>
+ * <li>If subclassing DateMenu, any configuration options for the DatePicker must be
+ * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.
+ * Applying {@link Ext.DatePicker DatePicker} configuration settings to
+ * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>
+ * </ul></div>
+ * @xtype datemenu
+ */
+ Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
+    /** 
+     * @cfg {Boolean} enableScrolling
+     * @hide 
+     */
+    enableScrolling : false,
+    /**
+     * @cfg {Function} handler
+     * Optional. A function that will handle the select event of this menu.
+     * The handler is passed the following parameters:<div class="mdetail-params"><ul>
+     * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>
+     * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Object} scope
+     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
+     * function will be called.  Defaults to this DateMenu instance.
+     */    
+    /** 
+     * @cfg {Boolean} hideOnClick
+     * False to continue showing the menu after a date is selected, defaults to true.
+     */
+    hideOnClick : true,
+    
+    /** 
+     * @cfg {String} pickerId
+     * An id to assign to the underlying date picker. Defaults to <tt>null</tt>.
+     */
+    pickerId : null,
+    
+    /** 
+     * @cfg {Number} maxHeight
+     * @hide 
+     */
+    /** 
+     * @cfg {Number} scrollIncrement
+     * @hide 
+     */
+    /**
+     * The {@link Ext.DatePicker} instance for this DateMenu
+     * @property picker
+     * @type DatePicker
+     */
+    cls : 'x-date-menu',
+    
+    /**
+     * @event click
+     * @hide
+     */
+    
+    /**
+     * @event itemclick
+     * @hide
+     */
+
+    initComponent : function(){
+        this.on('beforeshow', this.onBeforeShow, this);
+        if(this.strict = (Ext.isIE7 && Ext.isStrict)){
+            this.on('show', this.onShow, this, {single: true, delay: 20});
+        }
+        Ext.apply(this, {
+            plain: true,
+            showSeparator: false,
+            items: this.picker = new Ext.DatePicker(Ext.applyIf({
+                internalRender: this.strict || !Ext.isIE,
+                ctCls: 'x-menu-date-item',
+                id: this.pickerId
+            }, this.initialConfig))
+        });
+        this.picker.purgeListeners();
+        Ext.menu.DateMenu.superclass.initComponent.call(this);
+        /**
+         * @event select
+         * Fires when a date is selected from the {@link #picker Ext.DatePicker}
+         * @param {DatePicker} picker The {@link #picker Ext.DatePicker}
+         * @param {Date} date The selected date
+         */
+        this.relayEvents(this.picker, ['select']);
+        this.on('show', this.picker.focus, this.picker);
+        this.on('select', this.menuHide, this);
+        if(this.handler){
+            this.on('select', this.handler, this.scope || this);
+        }
+    },
+
+    menuHide : function() {
+        if(this.hideOnClick){
+            this.hide(true);
+        }
+    },
+
+    onBeforeShow : function(){
+        if(this.picker){
+            this.picker.hideMonthPicker(true);
+        }
+    },
+
+    onShow : function(){
+        var el = this.picker.getEl();
+        el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode
+    }
+ });
+ Ext.reg('datemenu', Ext.menu.DateMenu);
+ /**
+ * @class Ext.menu.ColorMenu
+ * @extends Ext.menu.Menu
+ * <p>A menu containing a {@link Ext.ColorPalette} Component.</p>
+ * <p>Notes:</p><div class="mdetail-params"><ul>
+ * <li>Although not listed here, the <b>constructor</b> for this class
+ * accepts all of the configuration options of <b>{@link Ext.ColorPalette}</b>.</li>
+ * <li>If subclassing ColorMenu, any configuration options for the ColorPalette must be
+ * applied to the <tt><b>initialConfig</b></tt> property of the ColorMenu.
+ * Applying {@link Ext.ColorPalette ColorPalette} configuration settings to
+ * <b><tt>this</tt></b> will <b>not</b> affect the ColorPalette's configuration.</li>
+ * </ul></div> * 
+ * @xtype colormenu
+ */
+ Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {
+    /** 
+     * @cfg {Boolean} enableScrolling
+     * @hide 
+     */
+    enableScrolling : false,
+    /**
+     * @cfg {Function} handler
+     * Optional. A function that will handle the select event of this menu.
+     * The handler is passed the following parameters:<div class="mdetail-params"><ul>
+     * <li><code>palette</code> : ColorPalette<div class="sub-desc">The {@link #palette Ext.ColorPalette}.</div></li>
+     * <li><code>color</code> : String<div class="sub-desc">The 6-digit color hex code (without the # symbol).</div></li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Object} scope
+     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
+     * function will be called.  Defaults to this ColorMenu instance.
+     */    
+    
+    /** 
+     * @cfg {Boolean} hideOnClick
+     * False to continue showing the menu after a color is selected, defaults to true.
+     */
+    hideOnClick : true,
+    
+    cls : 'x-color-menu',
+    
+    /** 
+     * @cfg {String} paletteId
+     * An id to assign to the underlying color palette. Defaults to <tt>null</tt>.
+     */
+    paletteId : null,
+    
+    /** 
+     * @cfg {Number} maxHeight
+     * @hide 
+     */
+    /** 
+     * @cfg {Number} scrollIncrement
+     * @hide 
+     */
+    /**
+     * @property palette
+     * @type ColorPalette
+     * The {@link Ext.ColorPalette} instance for this ColorMenu
+     */
+    
+    
+    /**
+     * @event click
+     * @hide
+     */
+    
+    /**
+     * @event itemclick
+     * @hide
+     */
+    
+    initComponent : function(){
+        Ext.apply(this, {
+            plain: true,
+            showSeparator: false,
+            items: this.palette = new Ext.ColorPalette(Ext.applyIf({
+                id: this.paletteId
+            }, this.initialConfig))
+        });
+        this.palette.purgeListeners();
+        Ext.menu.ColorMenu.superclass.initComponent.call(this);
+        /**
+         * @event select
+         * Fires when a color is selected from the {@link #palette Ext.ColorPalette}
+         * @param {Ext.ColorPalette} palette The {@link #palette Ext.ColorPalette}
+            * @param {String} color The 6-digit color hex code (without the # symbol)
+         */
+        this.relayEvents(this.palette, ['select']);
+        this.on('select', this.menuHide, this);
+        if(this.handler){
+            this.on('select', this.handler, this.scope || this);
+        }
+    },
+
+    menuHide : function(){
+        if(this.hideOnClick){
+            this.hide(true);
+        }
+    }
+});
+Ext.reg('colormenu', Ext.menu.ColorMenu);