Domanda

Given a component like this:

{xtype: 'textfield', name: 'title', fieldLabel: 'Title', autoFocus: true}

Is it possible to query for all items in an arbitary container (say a window) that have an attribute autoFocus to call the method .focus(...) on it?

Tried...

'[autoFocus]'

'*[autoFocus]'

'*[autoFocus=true]'

...with component.down and Ext.ComponentQuery.query (and others), but no luck.

È stato utile?

Soluzione

Ext.ComponentQuery.query('textfield[autoFocus]') should work, provided that the textfield is instantiated.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top