jQuery UI Widgets Forums Lists ListBox How to get the Value of the first item in the viewport?

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 6 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • Michael Gross
    Participant

    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
    Michael


    Hristo
    Participant

    Hello Michael Gross,

    Please, take a look this example:
    https://www.jseditor.io/?key=listbox-first-item

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    Michael Gross
    Participant

    Thank 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?


    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.