Results 1 to 4 of 4

Thread: Combobox is not scrolled automatically to the selected item for the first time.

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    6

    Default Combobox is not scrolled automatically to the selected item for the first time.

    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.

  2. #2
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124

    Default use insert and remove

    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).
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    6

    Default

    Quote Originally Posted by sword-it View Post
    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.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    6

    Default

    Should it be added to an issue tracker?

Posting Permissions

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