PDA

View Full Version : ComboBox DisplayValue too long



MO2k4
28 Aug 2014, 1:41 AM
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

mitchellsimoens
4 Sep 2014, 7:55 AM
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.

MO2k4
7 Sep 2014, 11:17 PM
"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 (http://www.sencha.com/forum/showthread.php?95486-Cursor-Position-in-TextField&p=854075&viewfull=1#post854075)) 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)