pc.adams@live.co.uk
16 Jan 2012, 5:46 AM
Hi All,
I am trying to render out a class (follows) but it does not render at all. Its based arround several different examples, and I have cut it down to the bare bones. If i add a renderTo to the combobox and set it to a div with an ID outside of the class it renders correctly, but I cannot get it to render within the class items array
Ext.define('Ext.chooser.IconBrowser', { extend: 'Ext.view.View', alias: 'widget.iconbrowser', id: 'mainBrowser', uses: ['Ext.form.Panel', 'Ext.form.field.ComboBox'], initComponent: function () { Ext.define('State', { extend: 'Ext.data.Model', fields: [ { type: 'string', name: 'abbr' }, { type: 'string', name: 'name' }, { type: 'string', name: 'slogan' } ] }); // The data for all states var states = [ { "abbr": "AL", "name": "Alabama", "slogan": "The Heart of Dixie" }, { "abbr": "AK", "name": "Alaska", "slogan": "The Land of the Midnight Sun" } ]; // The data store holding the states; shared by each of the ComboBox examples below mainStore = Ext.create('Ext.data.Store', { model: 'State', data: states }); this.items = [ Ext.create('Ext.form.field.ComboBox', { fieldLabel: 'Select a single state', displayField: 'name', width: 320, labelWidth: 130, store: mainStore, queryMode: 'local', typeAhead: true })] }
});
I am trying to render out a class (follows) but it does not render at all. Its based arround several different examples, and I have cut it down to the bare bones. If i add a renderTo to the combobox and set it to a div with an ID outside of the class it renders correctly, but I cannot get it to render within the class items array
Ext.define('Ext.chooser.IconBrowser', { extend: 'Ext.view.View', alias: 'widget.iconbrowser', id: 'mainBrowser', uses: ['Ext.form.Panel', 'Ext.form.field.ComboBox'], initComponent: function () { Ext.define('State', { extend: 'Ext.data.Model', fields: [ { type: 'string', name: 'abbr' }, { type: 'string', name: 'name' }, { type: 'string', name: 'slogan' } ] }); // The data for all states var states = [ { "abbr": "AL", "name": "Alabama", "slogan": "The Heart of Dixie" }, { "abbr": "AK", "name": "Alaska", "slogan": "The Land of the Midnight Sun" } ]; // The data store holding the states; shared by each of the ComboBox examples below mainStore = Ext.create('Ext.data.Store', { model: 'State', data: states }); this.items = [ Ext.create('Ext.form.field.ComboBox', { fieldLabel: 'Select a single state', displayField: 'name', width: 320, labelWidth: 130, store: mainStore, queryMode: 'local', typeAhead: true })] }
});