EXT.JS getting a list of items from a fieldset

拟墨画扇 提交于 2019-12-11 23:22:48

问题


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?


回答1:


You can use container.down(selector) or if its a form field use form.findField(name).

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.



来源:https://stackoverflow.com/questions/13884322/ext-js-getting-a-list-of-items-from-a-fieldset

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!