jpcook01
6 Sep 2011, 7:47 AM
Hi,
I have defined a combo in a separate class as follows:
/*
* A combo box for selecting different sitemaps
* @author cookj02
*/
Ext.define('NavBuilder.SitemapComboBox', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.sitemapcombo',
initComponent: function(){
Ext.apply(this, {
mode: 'local',
value: 'Standard',
triggerAction: 'all',
forceSelection: true,
editable: false,
fieldLabel: 'Sitemap',
labelWidth: 50,
width: 270,
name: 'selectsitemapcombo',
itemId: 'selectsitemapcombo',
displayField: 'uri',
valueField: 'uri',
store: Ext.create('Ext.data.Store', {
model: 'NavBuilder.SitemapItem',
proxy: {
type: 'ajax',
url: 'sitemap/list'
},
autoLoad: true,
listeners: {
load: function(store, records, successful, operation, eOpts ){
//some action
//sitemapcombo.setValue(store.getAt(0).get('uri'));
}
}
})
});
this.callParent();
}
});
But when I reference it from another class eg)
tems: [{
xtype: 'sitemapcombo'
}, {
xtype: 'tbseparator'
}, {.....
I get the following error: namespace is undefined
It is fine inline. Probably something silly.
Jon
I have defined a combo in a separate class as follows:
/*
* A combo box for selecting different sitemaps
* @author cookj02
*/
Ext.define('NavBuilder.SitemapComboBox', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.sitemapcombo',
initComponent: function(){
Ext.apply(this, {
mode: 'local',
value: 'Standard',
triggerAction: 'all',
forceSelection: true,
editable: false,
fieldLabel: 'Sitemap',
labelWidth: 50,
width: 270,
name: 'selectsitemapcombo',
itemId: 'selectsitemapcombo',
displayField: 'uri',
valueField: 'uri',
store: Ext.create('Ext.data.Store', {
model: 'NavBuilder.SitemapItem',
proxy: {
type: 'ajax',
url: 'sitemap/list'
},
autoLoad: true,
listeners: {
load: function(store, records, successful, operation, eOpts ){
//some action
//sitemapcombo.setValue(store.getAt(0).get('uri'));
}
}
})
});
this.callParent();
}
});
But when I reference it from another class eg)
tems: [{
xtype: 'sitemapcombo'
}, {
xtype: 'tbseparator'
}, {.....
I get the following error: namespace is undefined
It is fine inline. Probably something silly.
Jon