jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ListBox › how to make Listbox items on select scroll to the top?
Tagged: listbox bring into view
This topic contains 8 replies, has 2 voices, and was last updated by bobsov 11 years, 7 months ago.
-
Author
-
I would like to have selected item in listbox automatically scroll to the top. How do I do that?
Hi bobsov,
The “ensureVisible” method automatically scrolls the widget to an item at a specific index.
Ex:
$("#jqxListBox").jqxListBox('ensureVisible', 2 );
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comensureVisible is good but I really want is selected item all the way to the top and any items above it to be hidden in scrollbar. This is not to be mistaken with sorting, it is just that item scrolls to the top. Hope I am making myself clear here. Thank you for your help Peter.
Hi bobsov,
jqxListBox automatically scrolls to the selected item when you do keyboard navigation – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxlistbox/index.htm. If you select an item through the API, you can use “ensureVisible”. Other features not demonstrated in the demos section are most probably not available.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comUnderstood. If this feature is to be requested as a separate paid request, would you guys be able to provide me that and how much would it cost?
Here is working example using simple un orderered list. How to make this happen for jqxListbox?
http://jsfiddle.net/729nX/1/Based on the example above on using simple list, how can I make this happen for jqxListbox.
Hi bobsov,
If the item is in the view, “ensureVisible” would not change the scroll position. As far as I understand you want the scrollbar to be moved even if the item is visible and when it is actually not necessary. I am afraid that is something which is not supported by our widget.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comOh no. In this case, I have to go back and use regular html un-ordered list and loose other functionality provided by jqxListBox. That is sad. This relatively looks like a simple twist/hack within jqxListbox to make it happen.
-
AuthorPosts
You must be logged in to reply to this topic.