Really odd ComboBox behavior. Select a value then switch focus to another field and the combobox gets what looks like the results of the displayTpl with empty values appended to it.
See the Fiddle below. What is wrong with this example?
Really odd ComboBox behavior. Select a value then switch focus to another field and the combobox gets what looks like the results of the displayTpl with empty values appended to it.
See the Fiddle below. What is wrong with this example?
Then there's this version that clears the field when focus moves to the other field. I must be missing something major here...
https://fiddle.sencha.com/#view/editor&fiddle/2m7r
Gah, the demo in the docs misbehaves too! See the Customized Combobox example (the second one) on the page linked below.
https://docs.sencha.com/extjs/6.5.3/....ComboBox.html
Select a value then click elsewhere in the panel and the field content is duplicate; "Foo" becomes "Foo Foo". Do it again it doubles again. Gah!
Still tinkering with this but no luck. Anyone see where I'm going wrong?
I don't think you're doing anything wrong. It looks like a bug with the displayTpl functionality. When using it, the combobox doesn't know what its value is anymore. It thinks the value is the result of the template execution. When you have forceSelection: true, it keeps clearing it and when you don't it keeps appending the value it thinks it has. Sencha should respond and fix this.
A viable workaround might be to have a converter in the model build the string you want to display as the display field in the combo and then reference this rather than using an XTemplate directly.
For example, https://fiddle.sencha.com/#view/editor&fiddle/2m99
Thanks much for the work around.