-
23 Jul 2012 12:35 AM #1
Answered: 4.1.1 - How to setValue of a comboBox with multiSelect: true ?
Answered: 4.1.1 - How to setValue of a comboBox with multiSelect: true ?
Hi!
How can I set the value of a combobox with multiSelect = true?
my code (working in ExtJs 4.0.7) doesn't work in 4.1.1:
My example: http://www.electricblueskies.com/smeraldo/es03.htmlCode:var cbCaratteristica = Ext.create('Ext.form.field.ComboBox', { name: 'cbCaratteristica', id: 'id_cbCaratteristica', fieldLabel: 'Caratteristica', displayField: 'cadesc', valueField: 'idcara', width: 450, labelWidth: 100, store: storeCaratteristica, queryMode: 'local', allowBlank: false, forceSelection: true, multiSelect: true }); ... function setValCbCaratteristica() { var_caratteristica = "1,2"; // the same with "1, 2" cbCaratteristica.reset(); cbCaratteristica.setValue(var_caratteristica); }
-
Best Answer Posted by Dafram
NB: displayField is different from valueField.
I try to set value using value field...
Any suggestion?
-
23 Jul 2012 5:19 AM #2
NB: displayField is different from valueField.
I try to set value using value field...
Any suggestion?
-
23 Jul 2012 5:34 AM #3
Try to use array of values instead of string.
Code:var_caratteristica = [1, 2]; cbCaratteristica.reset(); cbCaratteristica.setValue(var_caratteristica);
-
23 Jul 2012 6:17 AM #4
I found a thing.
For combobox ["1","2"] is different from [1,2]


Reply With Quote