EXT.JS从字段集中获取项目列表 [英] EXT.JS getting a list of items from a fieldset
问题描述
如何从Ext.form.Fieldset
获取项目列表?我正在尝试根据其属性之一找到一个组件,这是我到目前为止所掌握的:
How can I get a list of items from a Ext.form.Fieldset
? I'm trying to find a component based on one of its properties, this is what I've got so far:
Ext.each(container.items, function (component) {
if (component.name == config.name) {
component.doUpdate(config);
}
}, me);
当然,项是未定义的...那么我该怎么做才能访问容器中包含的组件(这是一个字段集)?
Of course, items is undefined...so what can I do to access the components contained in my container, which is a fieldset?
推荐答案
您可以使用container.down(selector),或者如果其表单字段使用form.findField(name).
You can use container.down(selector) or if its a form field use form.findField(name).
有关在extjs应用中查找"事物的不同方法,请参见以下答案: 测试extjs应用
See this answer on the different ways to 'find' things in an extjs app: Testing extjs apps
对于表单字段,这里给出了列出不同技巧的答案:访问相邻组件/字段的最佳方法
For form fields here is an answer that lists different tricks: Best way to access adjacent components / fields
EDIT: Use container.query(selector) method to get an array of objects. As down() method returns first found.
这篇关于EXT.JS从字段集中获取项目列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!