Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / CycleButton.html
index 7abc37f..1b14352 100644 (file)
@@ -1,17 +1,12 @@
-<html>
-<head>
-  <title>The source code</title>
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body  onload="prettyPrint();">
-    <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-<div id="cls-Ext.CycleButton"></div>/**\r
+<html>\r
+<head>\r
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    \r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.CycleButton"></div>/**\r
  * @class Ext.CycleButton\r
  * @extends Ext.SplitButton\r
  * A specialized SplitButton that contains a menu of {@link Ext.menu.CheckItem} elements.  The button automatically\r
@@ -104,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
@@ -145,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
@@ -156,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
@@ -198,6 +192,6 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
         }\r
     }\r
 });\r
-Ext.reg('cycle', Ext.CycleButton);</pre>
-</body>
+Ext.reg('cycle', Ext.CycleButton);</pre>    \r
+</body>\r
 </html>
\ No newline at end of file