Ext JS -DOM Query question
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!
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.
精彩评论