The current findParentByType method doesn't support inheritance search.
There are many cases where it is usefull to be able to find a parent by its parent class.
Here's a replacement for the native Ext.Component.findParentByType method.
This method is supporting inheritance search for class names and xtypes.
Code:
Ext.override(Ext.Component, {
findParentByType: function(type){
if (Ext.isFunction(type)){
return this.findParentBy(function(p){
return p instanceof type;
});
} else {
return (Ext.isFunction(Ext.ComponentMgr.types[type]))?
this.findParentByType(Ext.ComponentMgr.types[type]):
null;
}
}
});