tags:

views:

275

answers:

1

Ok another DOMQuery question. i think the EXT API docs are a little scarce on this.

Inside my FormPanel I have mulitple fieldsets, but need to find the one that has a header title of 'Test Results'.

Does anyone know if Ext provides a helper function to do something like this or will i need to do soemthing like formPanel.findByType("fieldset", true), and then do a for each loop looking for that particular title...?

Thanks!

+1  A: 

Using Ext.form.FormPanel's find method:

var fieldSets = formPanel.find('title', 'Test Results');

Be aware that the return value is an array of found items.

A slightly more paranoid way using Ext.util.MixedCollection's find method:

var fieldSet = formPanel.items.find(function( item ) {
    return item instanceof Ext.form.FieldSet
        && item.title == 'Test Results';
});

Here the return value is only the first item found.

owlness
worked great. thanks!
29er