Extjs5: How to query a component by various properties
-
20-12-2019 - |
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.
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