Results 1 to 6 of 6

Thread: Odd Combobox Behavior

  1. #1

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    190
    Answers
    6

    Default Odd Combobox Behavior

    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?


  2. #2

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    190
    Answers
    6

    Default

    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

  3. #3

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    190
    Answers
    6

    Default

    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!

  4. #4

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    190
    Answers
    6

    Default

    Still tinkering with this but no luck. Anyone see where I'm going wrong?

  5. #5
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    459
    Answers
    19

    Default

    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

  6. #6

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    190
    Answers
    6

    Default

    Thanks much for the work around.

Similar Threads

  1. [2.2.1] ComboBox odd behavior in Firefox
    By Mahamoti1129 in forum Ext 2.x: Bugs
    Replies: 2
    Last Post: 27 Apr 2010, 6:25 AM
  2. ComboBox/Store behavior
    By nak1 in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 18 Aug 2009, 7:13 AM
  3. ComboBox behavior when nothing is selected
    By tryanDLS in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 15 Mar 2007, 7:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •