PDA

View Full Version : Traversing a form / Ext.Element to its real Ext type



Araberen
2 Dec 2011, 5:04 PM
Hi,

I'm simply trying to get the text of the last text input of my form.
Till now, I'm using select:

myFormVar.select('input[type=text]').last();

But it gives me an Ext.Element. I would like to get the Ext.form.field.Text to use its properties...

skirtle
2 Dec 2011, 8:02 PM
In general you can't go from an element back to the component. In a specific case you can usually work it out, for example by reading off a matching id, but it's not usually a good idea. One case where it can be needed is for event listeners on elements with delegation.

You probably just want to use a component query instead of resorting to selector queries.