Dec 10, 2010, 2:22 PM
[CLOSED] Items not showing as part of Ext.form.CompositeField
I have built a custom control that inherits from Ext.form.CompositeField that contains 2 components (1 ComboBox to select the month and 1 ComboBox to select the year). I have added the controls by applying the following code below.
Do I need to apply the ComboBoxes to a different collection in 1.0? What changed in 1.0 with the CompositeField's items collection?
Thank you in advance!
Ext.ux.AccountingPeriod = Ext.extend(Ext.form.CompositeField,
{
constructor: function(cfg) {
Ext.ux.AccountingPeriod.superclass.constructor.apply(this, arguments);
this.addEvents
(
'periodchanged'
);
var combos = [
new Ext.form.ComboBox({
store: Ext.GregorianData.Months,
autoShow: true,
displayField: 'Name',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText: 'Month',
width: this.monthWidth,
selectOnFocus: true,
listeners: {
scope: this,
'select': function() {
this.fireEvent('periodchanged');
}
}
}),
new Ext.form.ComboBox({
store: Ext.GregorianData.Years,
autoShow: true,
displayField: 'Name',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText: 'Year',
width: this.yearWidth,
selectOnFocus: true,
listeners: {
scope: this,
'select': function() {
this.fireEvent('periodchanged');
}
}
})
];
Ext.apply(this.items, combos);
This used to work before the 1.0 upgrade. Now, I am getting an error stating this.items.items[0] is null. I have tried changing the references to this.items[0], this.items[1], etc. which gets rid of the error but the ComboBoxes are not visible.Do I need to apply the ComboBoxes to a different collection in 1.0? What changed in 1.0 with the CompositeField's items collection?
Thank you in advance!
Last edited by Daniil; Dec 11, 2010 at 11:21 AM.
Reason: [CLOSED]