Fire event on element
Playing with the slide up/down example in the manual. I want to see how custom events work, so I've introduced an event called slidetextup and now I want to fire this even when the click event is called, however Element does not expose fireEvent - it seems only Ext obj expose this:
//simple slide of this element
var textup = Ext.get('textup');
What am I doing wrong? What is the fireEvent equivalant on Ext Element?
An Ext.Element does not extend Ext.Observable. It is merely a wrapper of a DOM element, and exposes the DOM element's event.
so now I wrap my element in an object that extends observerable so I can fireEvents myself:
MySpecialHyperlink = function(domElement)
this.el = domElement.dom;
var me = new MySpecialHyperlink(Ext.get('textup'));
Now how can I get Ext.get('textup') to return an instance of MySpecialHyperlink without having to do the explicit conversion each time?
Ext.get returns an Element wrapper of a DOM element.
You need to keep a reference to the created MySpecialHyperlink object.