PDA

View Full Version : Extend Ext ComponentMgr



genTaliaru
14 Apr 2009, 10:40 PM
I'ld like to add a function to Ext.getCmp()

var myFunction()
{

//do Somethinf
}

result shouldbe

Ext.getCmp().myfunction()

tjstuart
14 Apr 2009, 10:54 PM
getCmp() is a method which returns an Ext.Component. If you really must do what you said ie. Ext.getCmp(...).myFunction() then you could do the following:-


Ext.Component.prototype.myFunction = function() {
// do something
};

Then you can call it like:-


Ext.getCmp(...).myFunction()

genTaliaru
15 Apr 2009, 7:54 AM
thanks a lot