0

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?

Grahame A
  • 3,903
  • 12
  • 46
  • 70

1 Answers1

2

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.

Community
  • 1
  • 1
dbrin
  • 15,525
  • 4
  • 56
  • 83
  • I'm looking to get a collection of components, not form fields. Will container.down('myapp.mycomponent') return a list of components? – Grahame A Dec 14 '12 at 19:27
  • see edits and make sure to click on the link to see the documentation – dbrin Dec 14 '12 at 19:36