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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top