PDA

View Full Version : Combobox is not scrolled automatically to the selected item for the first time.



serious
15 May 2012, 12:01 AM
Hi,

I want combobox to show currently selected item on top of the drop-down list.
Say, I have 100 items in my combobox, item 70 is selected but it is not shown to the user just after down arrow is clicked and list is expanded, user needs to scroll the list down in order to find currenly selected item.

Is it possible to bring the selected item on top of the list?
I found that it is not scrolled down only for the first time when the list is expanded.

Thanks.

sword-it
15 May 2012, 12:32 AM
Hi Serious,

although there is not any method present to swipe the position of two records in the store but there is an another way to do this.

Step1:- find the id of the selected record in your combobox (use select event of combobox).

Step 2:- find the selected record in your combobox store matching with your selected record (in combobox)
(use getById() method of store for finding record).

Step 3:- Keep your selected record's id and name (Use later when adding new record) , remove your selected record from combostore by using remove() method.

Step 4 :- Add a record with your saved id and name to your combo store by using insert() method of store with the specific number (index).

serious
15 May 2012, 3:15 AM
Step 4 :- Add a record with your saved id and name to your combo store by using insert() method of store with the specific number (index).
Yes, but this won't scroll the list to the currently selected item. It is only about removing selected item from one position and putting it to another.
The problem is that it is working correctly on second, third and so on time but for the first time it doesn't scroll viewport to the selected item. I consider it to be a bug.

serious
21 May 2012, 1:29 AM
Should it be added to an issue tracker?