jQuery UI Widgets › Forums › General Discussions › Lists › ListBox › How to get the Value of the first item in the viewport?
Tagged: Angular listbox, bootstrap listbox, javascript listbox, jQuery ListBox, jqwidgets listbox, jqxListBox, ListBox, Viewport
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 9 years, 6 months ago.
-
Author
-
I have a ListBox for Mobilebrowsers with several hundreds of items. The scrolling through the items by wiping is running nicely, but I have to display always the first item value occurring in the viewport for orientation. As the scrollbar runs beside with the scrolling of the items, there must be a possibility to identify the items in the viewport. How can I identify this uppermost item value without having to select the item or alternatively how can I get the value of the scrollbar?
Thank you for your help
MichaelHello Michael Gross,
Please, take a look this example:
https://www.jseditor.io/?key=listbox-first-itemBest Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comThank you for the reply, but the example shows only the identification of a selected item. Perhaps my explanation was not detailed enough: The Listbox has 1000 items with the values 1 – 1000. The items itself are displayed as an image through custom rendering, the value-members are the numbers. I would like to use the mobile wiping action which makes the listbox scrolling through the images without selecting any. This works fine, but in addition I have to show the current number of the image in the viewport (which is not selected, but comes into the viewport through the wiping action). How can I identify the item occurring in the viewport?
Hello Michael Gross,
The shared example work without selected item. (You could try to set
selectedIndex: -1,and to test again)
You could use getItems method from the ListBox and with comparison to get current number of the image.
Also could add specific id for each one item so that shows the current number of elements.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.