PDA

View Full Version : Get all type items in Form



test45
15 Oct 2010, 2:46 AM
Hello,
Again I need help.

Is there a way to get all combobox in formpanel ?

In fact, my form has combobox with id's attribute built dynamically (ex: "checkThisOut_1", "checkThisOut_25", "checkThisOut_187", ...).
The best will be to get all component started by "checkThisOut_".


Thanks in advance.
nb: Sorry for my poor english

Animal
15 Oct 2010, 2:59 AM
http://dev.sencha.com/deploy/dev/docs/?class=Ext.Component?class=Ext.Container&member=findByType ?

test45
15 Oct 2010, 5:21 AM
Thanks findByType works well with xtype.

The documentation shows that I can get by class.
But this code doesn't work.

Example:

formEditArticle.add(new Ext.form.CompositeField({
id: "cep_compositefield" flag,
fieldLabel: libelle,
cls: "cep",
items: [
new Ext.form.NumberField({
name: flag,
id: "cep_numberfield_" flag,
value: pourcent,
allowBlank: false,
cls: "cep"
}),
new Ext.Button({
text: "Supprimer",
id: "cep_button_" flag,
cls: "cep",
handler: function(){}
})
]
}));
//////////////////
formEditArticle.findByType("cep", true);

Animal
15 Oct 2010, 5:31 AM
Class is Ext.form.NumberField or Ext.Button

Animal
15 Oct 2010, 5:32 AM
Ext 4 will allow more sophisticated ways of querying child Components within any Container.