X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/CycleButton.html?ds=inline
diff --git a/docs/source/CycleButton.html b/docs/source/CycleButton.html
index 777d7a18..cef6f87d 100644
--- a/docs/source/CycleButton.html
+++ b/docs/source/CycleButton.html
@@ -1,5 +1,6 @@
+
The source code
@@ -82,8 +83,8 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
* @param {Boolean} suppressEvent True to prevent the button's change event from firing (defaults to false)
*/
setActiveItem : function(item, suppressEvent){
- if(typeof item != 'object'){
- item = this.menu.items.get(item);
+ if(!Ext.isObject(item)){
+ item = this.menu.getComponent(item);
}
if(item){
if(!this.rendered){
@@ -140,18 +141,19 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
this.menu = {cls:'x-cycle-menu', items:[]};
var checked;
- for(var i = 0, len = this.itemCount; i < len; i++){
- var item = this.items[i];
- item.group = item.group || this.id;
- item.itemIndex = i;
- item.checkHandler = this.checkHandler;
- item.scope = this;
- item.checked = item.checked || false;
+ Ext.each(this.items, function(item, i){
+ Ext.apply(item, {
+ group: item.group || this.id,
+ itemIndex: i,
+ checkHandler: this.checkHandler,
+ scope: this,
+ checked: item.checked || false
+ });
this.menu.items.push(item);
if(item.checked){
checked = item;
}
- }
+ }, this);
this.setActiveItem(checked, true);
Ext.CycleButton.superclass.initComponent.call(this);
@@ -171,13 +173,18 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
* the active item will be set to the first item in the menu.
*/
toggleSelected : function(){
- this.menu.render();
+ var m = this.menu;
+ m.render();
+ // layout if we haven't before so the items are active
+ if(!m.hasLayout){
+ m.doLayout();
+ }
var nextIdx, checkItem;
for (var i = 1; i < this.itemCount; i++) {
nextIdx = (this.activeItem.itemIndex + i) % this.itemCount;
// check the potential item
- checkItem = this.menu.items.itemAt(nextIdx);
+ checkItem = m.items.itemAt(nextIdx);
// if its not disabled then check it.
if (!checkItem.disabled) {
checkItem.setChecked(true);