PDA

View Full Version : onFieldChange Not working for FormPanel



Steve Lewis
28 Oct 2010, 7:43 AM
Hi,

I've run into a problem when upgrading to 0.97 toolkit with FormPanel events. The onFieldChange is not firing (but used to in 0.92). Code is listed below (it seems to be the same as Kiva example). The filterbar in being created as part of a Carousel. Any idea's as to what may be going wrong?

Spinach.views.FilterBar = Ext.extend(Ext.form.FormPanel, {
baseCls: 'x-toolbar',
cls: 'x-toolbar-dark',
ui: 'green',

initComponent : function() {
this.layout = {
type: 'hbox',
pack: 'center',
align: 'center'
};

this.defaults = {
listeners: {
change: this.onFieldChange,
scope: this
}
};

this.items = [
{
xtype: 'select',
name: 'category',
options: [
{text: 'Category: All', value: ''},
{text: 'Shopping', value: '1'},
{text: 'Night Life', value: '2'},
{text: 'Events', value: '3'},
{text: 'Travel', value: '4'},
{text: 'Dining & Food', value: '5'},
{text: 'Arts & Music', value: '6'},
{text: 'Gyms & Spas', value: '8'},
{text: 'Romance', value: '9'},
{text: 'Everyday', value: '10'}
]
} ];
this.addEvents('change');
Spinach.views.FilterBar.superclass.initComponent.call(this);
},

onFieldChange: function() {
Ext.getBody().mask(false, '<div class="loading">Loading&hellip;</div>');
this.fireEvent('change', this, this.getValues());
}
});

Ext.reg('spinach-filterbar', Spinach.views.FilterBar);

Any help is appreciate.

Thanks,
Steve