Missing Component and Container findCt bubble methods
January 8th, 2009
Ext.apply(Ext.Container.prototype,{
findCtById : function(id){
var m, ct = this;
this.bubble(function(c){
if(ct != c && c.id === id){
m = c;
return false;
}
});
return m null;
},
findCtByType : function(xtype){
return typeof xtype == 'function' ?
this.findCtBy(function(c){
return c.constructor === xtype;
}) :
this.findCtBy(function(c){
return c.constructor.xtype === xtype;
});
},
findCt : function(prop, value){
return this.findByCt(function(c){
return c[prop] === value;
});
},
findCtBy : function(fn, scope){
var m = , ct = this;
this.bubble(function(c){
if(ct != c && fn.call(scope c, c, ct) === true){
m.push(c);
}
});
return m;
}
});
Ext.apply(Ext.Component.prototype,{
bubble : function(fn, scope, args){
var p = this;
while(p){
if(fn.apply(scope p, args [p]) === false){
break;
}
p = p.ownerCt;
}
},
findCtById : function(id){
var m, ct = this;
this.bubble(function(c){
if(ct != c && c.id === id){
m = c;
return false;
}
});
return m null;
},
findCtByType : function(xtype){
return typeof xtype == 'function' ?
this.findCtBy(function(c){
return c.constructor === xtype;
}) :
this.findCtBy(function(c){
return c.constructor.xtype === xtype;
});
},
findCt : function(prop, value){
return this.findByCt(function(c){
return c[prop] === value;
});
},
findCtBy : function(fn, scope){
var m = , ct = this;
this.bubble(function(c){
if(ct != c && fn.call(scope c, c, ct) === true){
m.push(c);
}
});
return m;
}
});
Thanks,
Jerry
http://extjs.com/forum/showthread.php?p=118908#post118908
But remember a Container isa Component. Check the inheritance.
#If you have any other info about this subject , Please add it free.# |
Posted in freedeadaim.com | edit
A little something about you, the author. Nothing lengthy, just an overview.