Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / CycleButton.html
index cef6f87..1b14352 100644 (file)
@@ -99,7 +99,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
             }\r
             this.activeItem = item;\r
             if(!item.checked){\r
-                item.setChecked(true, true);\r
+                item.setChecked(true, false);\r
             }\r
             if(this.forceIcon){\r
                 this.setIconClass(this.forceIcon);\r
@@ -140,7 +140,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
         this.itemCount = this.items.length;\r
 \r
         this.menu = {cls:'x-cycle-menu', items:[]};\r
-        var checked;\r
+        var checked = 0;\r
         Ext.each(this.items, function(item, i){\r
             Ext.apply(item, {\r
                 group: item.group || this.id,\r
@@ -151,13 +151,12 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
             });\r
             this.menu.items.push(item);\r
             if(item.checked){\r
-                checked = item;\r
+                checked = i;\r
             }\r
         }, this);\r
-        this.setActiveItem(checked, true);\r
         Ext.CycleButton.superclass.initComponent.call(this);\r
-\r
         this.on('click', this.toggleSelected, this);\r
+        this.setActiveItem(checked, true);\r
     },\r
 \r
     // private\r