ExtJS: Adding prototype to Ext-wrapped DOM element
In jQuery, I can add an extension to a jQuery DOM element like so:
jQuery.fn.blowUp = function() { ... }
Used like:
$("#myDiv").blowUp();
In ExtJS, instead of $()
, one uses Ext.get()
. Given that, how can I write my blowUp()
as an extension on the ret开发者_开发问答urn of Ext.get()
so that I can:
Ext.get('myDiv').blowUp();
Ext.get returns Ext Element, so you can probably try this
Ext.Element.prototype.blowUp = function() {...}
Good luck!
精彩评论