1. #1
    Sencha User
    Join Date
    Jun 2014
    Posts
    2
    Vote Rating
    0
    MO2k4 is on a distinguished road

      0  

    Default Unanswered: ComboBox DisplayValue too long

    Unanswered: ComboBox DisplayValue too long


    Hi,

    i have a problem with a combobox and a very long displayvalue. After i select a value and the cursor moves to the end, the displayed value is at the end, but i need it to be at the first position.

    how can i achieve that without have to focus the box? i already tried, to override the onBeforeBlur of the ComboBox to move the caret to the start when i leave the box, but then i get a strange behavior when leaving the box.

    Do you have an idea how i get the displayvalue to be at the first position of the text when i leave the combobox?

    I am using ExtJS 4.2.1 and i need a solution for IE 9/10/11.

    Thanks for your help

    MO

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to change the behavior when a value is selected, not when the field is blurred. When the field is blurred the caret isn't in the field anymore and the browser should then show the value from the start.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2014
    Posts
    2
    Vote Rating
    0
    MO2k4 is on a distinguished road

      0  

    Default


    "the browser should then show the value from the start"

    that is exactly the problem, the box displays the value from the end and not the start

    i tried this solution (link) to move the cursor on select, but that did not work

    what i need is something to move the caret before the blur event, to get the caret back to the start when the box loses its focus (or before stop edit mode)

Thread Participants: 1