diff --git a/docs/lists/docs-lists.html b/docs/lists/docs-lists.html index 38025a0d657..3f20666dc2f 100755 --- a/docs/lists/docs-lists.html +++ b/docs/lists/docs-lists.html @@ -64,6 +64,17 @@

List dividers

List divider example +

Autodividers

+ +

A listview can be configured to automatically generate dividers for its items. This is done by adding a data-autodividers attribute to any listview. The value of the attribute should be set to "alpha" (to create dividers based on unique, lowercased first characters of list items) or "full" (to create dividers based on unique full text strings of list items). Any existing dividers in the list are removed and replaced by the autogenerated dividers.

+ +

By default, the text used to create dividers is the link text (for link lists) or text (for read-only lists). Alternatively, if you are using formatted list items, you can specify the element to be used for dividers with data-autodividers-selector="X", where X is a selector string. Note that the selector is applied in the context of individual list (<li>) items.

+ +

If new list items (not dividers) are added to the list, or if items are removed, the dividers are automatically updated.

+ + Autodividers example + +

Search filter

jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the data-filter="true" attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data-attribute data-filter-placeholder on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data-attribute data-filter-theme on your listview.

@@ -125,6 +136,7 @@

More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/index.html b/docs/lists/index.html index ad97a3a8a20..61535a46e48 100755 --- a/docs/lists/index.html +++ b/docs/lists/index.html @@ -34,6 +34,7 @@

    Lists

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-all-full.html b/docs/lists/lists-all-full.html index 7582d856b18..f19c3887573 100644 --- a/docs/lists/lists-all-full.html +++ b/docs/lists/lists-all-full.html @@ -138,6 +138,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-autodividers.html b/docs/lists/lists-autodividers.html new file mode 100755 index 00000000000..e621767f3e4 --- /dev/null +++ b/docs/lists/lists-autodividers.html @@ -0,0 +1,99 @@ + + + + + + jQuery Mobile Docs - List Dividers + + + + + + + + + +
    + +
    +

    Autodividers

    + Home +
    + +
    + + + + +
    + + + +
    + + + diff --git a/docs/lists/lists-count.html b/docs/lists/lists-count.html index 8bc7c4ab538..235a9d0a156 100755 --- a/docs/lists/lists-count.html +++ b/docs/lists/lists-count.html @@ -47,6 +47,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-divider.html b/docs/lists/lists-divider.html index e5a4f54c25f..eaef72b4b63 100755 --- a/docs/lists/lists-divider.html +++ b/docs/lists/lists-divider.html @@ -78,6 +78,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-formatting.html b/docs/lists/lists-formatting.html index c0d3b72300f..c40a44b1cb4 100755 --- a/docs/lists/lists-formatting.html +++ b/docs/lists/lists-formatting.html @@ -98,6 +98,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-forms-inset.html b/docs/lists/lists-forms-inset.html index cbfeececd34..6b0a9543421 100644 --- a/docs/lists/lists-forms-inset.html +++ b/docs/lists/lists-forms-inset.html @@ -213,6 +213,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-forms.html b/docs/lists/lists-forms.html index 9be9025ca2c..1fa3b09651c 100644 --- a/docs/lists/lists-forms.html +++ b/docs/lists/lists-forms.html @@ -213,6 +213,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-icons.html b/docs/lists/lists-icons.html index ea09f891083..a5205a57e27 100755 --- a/docs/lists/lists-icons.html +++ b/docs/lists/lists-icons.html @@ -53,6 +53,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-inset.html b/docs/lists/lists-inset.html index a6395412e76..b1f5888d9ba 100755 --- a/docs/lists/lists-inset.html +++ b/docs/lists/lists-inset.html @@ -139,6 +139,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-nested.html b/docs/lists/lists-nested.html index 00f20a0fe70..4538ff466c4 100755 --- a/docs/lists/lists-nested.html +++ b/docs/lists/lists-nested.html @@ -158,6 +158,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-ol.html b/docs/lists/lists-ol.html index d4fd075443e..16f2da58f97 100755 --- a/docs/lists/lists-ol.html +++ b/docs/lists/lists-ol.html @@ -62,6 +62,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-performance.html b/docs/lists/lists-performance.html index 6a1ac73f296..a06f2a327c7 100755 --- a/docs/lists/lists-performance.html +++ b/docs/lists/lists-performance.html @@ -542,6 +542,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-readonly-inset.html b/docs/lists/lists-readonly-inset.html index 281c393cca4..86a12ca494d 100644 --- a/docs/lists/lists-readonly-inset.html +++ b/docs/lists/lists-readonly-inset.html @@ -135,6 +135,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-readonly.html b/docs/lists/lists-readonly.html index 6a54de69e73..1908d5e243a 100644 --- a/docs/lists/lists-readonly.html +++ b/docs/lists/lists-readonly.html @@ -137,6 +137,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-search-inset.html b/docs/lists/lists-search-inset.html index 8fc03815e52..71601f48fd6 100755 --- a/docs/lists/lists-search-inset.html +++ b/docs/lists/lists-search-inset.html @@ -64,6 +64,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-search-with-dividers.html b/docs/lists/lists-search-with-dividers.html index 444009593e8..2d515542dcd 100644 --- a/docs/lists/lists-search-with-dividers.html +++ b/docs/lists/lists-search-with-dividers.html @@ -77,6 +77,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-search.html b/docs/lists/lists-search.html index c134f0416b0..30ee3281bf3 100755 --- a/docs/lists/lists-search.html +++ b/docs/lists/lists-search.html @@ -64,6 +64,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-split.html b/docs/lists/lists-split.html index 6993d41a25b..15240bd04ec 100755 --- a/docs/lists/lists-split.html +++ b/docs/lists/lists-split.html @@ -111,6 +111,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-themes.html b/docs/lists/lists-themes.html index 0880fee6292..2b2f822cc33 100755 --- a/docs/lists/lists-themes.html +++ b/docs/lists/lists-themes.html @@ -228,6 +228,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-thumbnails.html b/docs/lists/lists-thumbnails.html index d4d748e64a7..f2802cfdfbd 100755 --- a/docs/lists/lists-thumbnails.html +++ b/docs/lists/lists-thumbnails.html @@ -99,6 +99,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/docs/lists/lists-ul.html b/docs/lists/lists-ul.html index f55703e0b6f..5915052eb5e 100755 --- a/docs/lists/lists-ul.html +++ b/docs/lists/lists-ul.html @@ -65,6 +65,7 @@

    More in this section

  • Split button list
  • List dividers
  • +
  • Autodividers
  • Count bubble
  • Thumbnails
  • Icons
  • diff --git a/js/index.php b/js/index.php index c0ade1d8c45..6a56946cc54 100644 --- a/js/index.php +++ b/js/index.php @@ -22,6 +22,7 @@ 'jquery.mobile.navbar.js', 'jquery.mobile.listview.js', 'jquery.mobile.listview.filter.js', + 'jquery.mobile.listview.autodividers.js', 'jquery.mobile.nojs.js', 'jquery.mobile.forms.checkboxradio.js', 'jquery.mobile.forms.button.js', diff --git a/js/jquery.mobile.listview.autodividers.js b/js/jquery.mobile.listview.autodividers.js new file mode 100644 index 00000000000..2547715000d --- /dev/null +++ b/js/jquery.mobile.listview.autodividers.js @@ -0,0 +1,237 @@ +/* +* jQuery Mobile Framework : "listview" autodividers extension +* Copyright (c) jQuery Project +* Dual licensed under the MIT or GPL Version 2 licenses. +* http://jquery.org/license +*/ + +/** + * Applies dividers automatically to a listview, using link text + * (for link lists) or text (for readonly lists) as the basis for the + * divider text. + * + * Apply using autodividers({type: 'X'}) on a