How do I bind to a combobox's name (ie display text) to some other component?
I have a combobox called 'combo', and I have a label in a panel somewhere else that updates itself with the combo display value. The two widgets are bound via a ViewModel.
If I set the bindings like this :
combo.setConfig({bind: {value: bindName}};
then the label will show the value of the combo (ie. key).
If I do this :
combo.setConfig({bind: {name: bindName}};
then I get this error message :
"Cannot bind name on Ext.form.field.ComboBox - missing a setName method."
I have gone through other getter/setter methods in combobox with no success, having tried :
combo.setConfig({bind: {name: displayField}};
combo.setConfig({bind: {name: rawValue}};
name
of a combobox is not the display text, but the name of the form field (if the name iscombo1
, the form will submit the valuevalue
ascombo1:value
or store it in the model field with namecombo1
. You are trying to bind to the "display value", which has no property and no config option to set it. I fear that you would have to do the bind manually. What are you trying to achieve? – Alexander