I am using ExtJS 4.0.7, new to Ext, and using the new MVC architecture. I have a RadioGroup, which, after a change, I want to use to show more user interface elements. The problem is that the change event is fired twice for RadioGroup. I assume this is because both Radios fire an event to change their values.
Is there a way to listen to changes in RadioGroup or Radios with the same name that will only fire once? In my experience with jQuery and Flex, I expected RadioGroup to only start once.
Here is the RadioGroup code in my opinion:
items: [{ xtype: 'radiogroup', id: 'WheatChoice', padding: '', layout: { padding: '-3 0 4 0', type: 'hbox' }, fieldLabel: 'Choose Model', labelPad: 5, labelWidth: 80, allowBlank: false, columns: 1, flex: 1, anchor: '60%', items: [ { xtype: 'radiofield', id: 'SpringWheat', padding: '2 10 0 0', fieldLabel: '', boxLabel: 'Spring', name: 'wheat-selection', inputValue: '0', flex: 1 }, { xtype: 'radiofield', id: 'WinterWheat', padding: '2 0 0 0', fieldLabel: '', boxLabel: 'Winter', name: 'wheat-selection', inputValue: '1', checked: true, flex: 1 } ] }]
Here is the corresponding code in my controller:
init: function() { this.control({ '#WheatChoice': { change: this.onWheatChange } }); }, onWheatChange: function(field, newVal, oldVal) {