As others have escaped here, the method used depends on the need, if you just want to get a reference to the dom element for some non Ext purpose, you can also use the built-in function, but if you intend to perform actions on the returned object in the Ext context, then Ext .get will return you a link to an element that offers additional methods.
Ext.get is a shorthand for Ext.ComponentManager.get, and although it is a library function call and may be less efficient, it should be noted that there are ~ 180 methods on Ext.Element, so if you need these, you can include a wrapper.
As co-compatibility said, Ext.fly () is designed when you need to perform one function for an element, for example. Ext.fly("myDiv").hide();
whereas Ext.get () is intended when you need an element reference for later use, for example. var something = Ext.get("myDiv");
, then maybe something.sort(); something.badger(); return something;
something.sort(); something.badger(); return something;
dougajmcdonald
source share