Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery Mobile List View

jQuery Mobile List View



jQuery Mobile List View

List views in jQuery Mobile are standard HTML lists; ordered (

    ) and unordered (
      ).

      List view is a powerful feature in jQuery Mobile. It makes standard unordered or ordered lists more widely applicable. The way to apply it is to add the data-role="listview" attribute to a ul or ol tag. Add a link in each item (

    • ) so the user can click it:

      Example

        data-role="listview"

         

      1. List item m

      Try it »

      For rounded corners and edges of list styles, use the data-inset="true" attribute:

      Example

        data-inset="true"

        Try it »

        lamp By default, links in list items automatically become buttons (no need for data-role="button").

        List dividers

        List items can also be turned into list dividers, used to organize lists and group list items.

        To specify a list divider, just add the data-role="list-divider" attribute to the list item

      • element:

        Example

        Try it »

        If you have an alphabetically ordered list (such as a phone book), you can configure it through the

          or
            element's data-autodividers="true" attribute to automatically generate item dividers:

            Example

            Try it »

            lamp data-autodividers="true" can be configured to automatically generate item dividers. By default, the generated divider text is the first uppercase letter of the list item text.

            More examples

            Read-only list
            How to create a list without links (it will not be a button and not clickable).

            Panel
            How to insert a panel in a list