我已经定义了一个检索的xtype的xtype:ExtJS的 - 使用自定义配置
Ext.define('Sample.view.CustomTextfield', {
extend: 'Ext.field.Text',
customConfig: 'foo'
. . . .
});
我想现在如果有创建使用customConfig
部件的方法。
做这样的事情myPanel.add(Ext.getComponentByConfig('customConfig', 'foo'));
有一个ExtJS这样做呢?
注:
自定义组件还没有渲染,但已经被定义因此使用ComponentQuery
答案等等(.up()
,.down()
,等)不正确。
编辑:
下面是一个示例用例:
据说你有对象键值对的数组:
var myArray = [
{ config: 'customConfig', value: 'foo' },
{ config: 'anotherCustomConfig', value: 'bar' },
. . . .
]
现在,我需要做的是遍历数组并检索config
属性,然后我将使用该属性来检索具有该值的配置的xtype,其值等于value
,即,对于配置customConfig
的值为foo
。简而言之,我想使用一个config->value
对象的数组动态呈现视图。
你的问题没有意义。 –
@EvanTrimboli,请参阅编辑 –
仍然没有任何意义。 –