开发者

ExtJS: Adding prototype to Ext-wrapped DOM element

开发者 https://www.devze.com 2023-03-08 05:08 出处:网络
In jQuery, I can add an extension to a jQuery DOM element like so: jQuery.fn.blowUp = function() { ... }

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消