开发者

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!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜