-
8 Sep 2011 3:05 AM #1
Can you configure a combo with inline data?
Can you configure a combo with inline data?
Hi,
Is it possible to configure a combo box in Ext Designer using in-line array data for the store property?
I just need a combo with 'True' and 'False' as options, and see you can use an inline array according to the ExtJS docs (v3.4). I had a go at setting this up in designer, generated code is below.
When I try and run the code that uses this combo box I get an error from the Extjs source code as follows:Code:MyCombo19Ui = Ext.extend(Ext.form.ComboBox, { width: 100, cellCls: 'configFieldCell', store: '[\'True\',\'False\']', mode: 'local', triggerAction: 'all', allowBlank: false, initComponent: function() { MyCombo19Ui.superclass.initComponent.call(this); } });
Thanks.Code:this.store is undefined http://localhost:8080/ext-3.3.1/ext-all-debug.js Line 41111
-
8 Sep 2011 6:24 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Store config should be a Store instance or an Array... what is there is a String so I assume ComboBox isn't recognizing it and creating a Store instance on the fly.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
8 Jan 2012 1:54 PM #3
It appears that when you specify the inline data (as an array) in the combo box's store config setting, Designer looks like its converting it to a string, I'm guessing this is a bug? But if you go in and directly edit the generated code (which you're not supposed to do) from:
to the following:Code:Ext.define('MyApp.view.ui.ComboTest', { extend: 'Ext.panel.Panel', initComponent: function() { var me = this; Ext.applyIf(me, { items: [ { xtype: 'combobox', fieldLabel: 'Label', store: '[\'one\',\'two\',\'three\',\'four\']' } ] }); me.callParent(arguments); } });
Code:Ext.define('MyApp.view.ui.ComboTest', { extend: 'Ext.panel.Panel', initComponent: function() { var me = this; Ext.applyIf(me, { items: [ { xtype: 'combobox', fieldLabel: 'Label', store: ['one','two','three','four'] } ] }); me.callParent(arguments); } });-- Once you go Mac, you never go back!
-
5 Feb 2012 9:45 PM #4
-
23 Jan 2013 12:04 AM #5
I've also just come across this issue - the array being treated as a string.
Is there a workaround?
Update
Must have been a syntax error as I can't replicate the issue now.


Reply With Quote
