PDA

View Full Version : Extending Ext.form.Combobox



errd
1 Jul 2010, 4:09 AM
I'm trying to extend Ext.form.Combobox to create custox xtype for object types list.



Registry.ObjectTypesCombo = Ext.extend(Ext.form.Combobox, {
initComponent: function() {
var config = {
xtype: 'combo',
mode: 'remote',
fieldLabel: m.get('objectType'),
name: 'objectType',
triggerAction: 'all',
editable: false,
forceSelection: true,
store: new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/Registry/objecttypes'
}),
storeId: 'objectTypes',
idProperty: 'id',
fields: ['id', 'name']
}),
displayField: 'name',
valueField: 'id'
};

Ext.apply(this, Ext.apply(this.initialConfig, config));
Registry.ObjectTypesCombo.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('objecttypescombo', Registry.ObjectTypesCombo);
The code above generates an error:


sp is undefined
spp = sp.prototype; ext-base-debug.js (line 237)
I have no idea what to do with this error. Help please!

evant
1 Jul 2010, 4:14 AM
ComboBox

errd
1 Jul 2010, 4:20 AM
Thank you! Such a stupid mistake :)