PDA

View Full Version : Radio take name from radiogroup



Bensiu
10 Jan 2011, 1:32 PM
how I can automaticly pickup a name from radiogroup and pass it to radio element:

xtype: 'radiogroup',
fieldLabel: 'Is Sale scheduled?',
name: 'SaleScheduled',



items: [
{ boxLabel: 'Yes', name: 'SaleScheduled', inputValue: 'YES' },
{ boxLabel: 'No', name: 'SaleScheduled', inputValue: 'NO' }
],
....

I tryed to use name: this.getName() or this.findParentByType ('radiogroup')
I try to created extended radiogroup element that will have to chooses Yes or No and I can have it defined as xtype

mitchellsimoens
10 Jan 2011, 3:57 PM
Ext.ns("MyApp");
MyApp.RadioGroup = Ext.extend(Ext.form.RadioGroupd, {
name: "MyRadio",
initComponent: function() {
this.items = this.buildRadios();
MyApp.RadioGroup.superclass.initComponent.call(this);
},
buildRadios: function() {
return [
{ boxLabel: "Yes", inputValue: "YES", name: this.name },
{ boxLabel: "No", inputValue: "NO", name: this.name }
];
}
});