Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Add autodividers functionality for listviews #2851

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/lists/docs-lists.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ <h2>List dividers</h2>
<a href="lists-divider.html" data-role="button" data-icon="arrow-r" data-iconpos="right">List divider example</a>


<h2>Autodividers</h2>

<p>A listview can be configured to automatically generate dividers for its items. This is done by adding a <code>data-autodividers</code> attribute to any listview. The value of the attribute should be set to <code>"alpha"</code> (to create dividers based on unique, lowercased first characters of list items) or <code>"full"</code> (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.</p>

<p>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 <code>data-autodividers-selector="X"</code>, where <code>X</code> is a selector string. Note that the selector is applied in the context of individual list (&lt;li&gt;) items.</p>

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

<a href="lists-autodividers.html" data-role="button" data-icon="arrow-r" data-iconpos="right">Autodividers example</a>


<h2>Search filter</h2>
<p>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 <code>data-filter="true"</code> 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 <code>mobileinit</code> event and set the <code>$.mobile.listview.prototype.options.filterPlaceholder</code> option to a string of your choosing, or use the data-attribute <code>data-filter-placeholder</code> 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 <code>data-filter-theme</code> on your listview.</p>

Expand Down Expand Up @@ -125,6 +136,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h1>Lists</h1>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-all-full.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
99 changes: 99 additions & 0 deletions docs/lists/lists-autodividers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Docs - List Dividers</title>
<link rel="stylesheet" href="../../css/themes/default/" />
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
<script src="../../js/jquery.js"></script>
<script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
<script src="../_assets/js/jqm-docs.js"></script>
<script src="../../js/"></script>
</head>
<body>

<div data-role="page" class="type-interior">

<div data-role="header" data-theme="f">
<h1>Autodividers</h1>
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
</div><!-- /header -->

<div data-role="content">
<div class="content-primary">
<ul data-role="listview" data-autodividers="alpha">
<li><a href="index.html">Adam Kinkaid</a></li>
<li><a href="index.html">Alex Wickerham</a></li>
<li><a href="index.html">Avery Johnson</a></li>
<li><a href="index.html">Bob Cabot</a></li>
<li><a href="index.html">Caleb Booth</a></li>
<li><a href="index.html">Christopher Adams</a></li>
<li><a href="index.html">Culver James</a></li>
<li><a href="index.html">David Walsh</a></li>
<li><a href="index.html">Drake Alfred</a></li>
<li><a href="index.html">Elizabeth Bacon</a></li>
<li><a href="index.html">Emery Parker</a></li>
<li><a href="index.html">Enid Voldon</a></li>
<li><a href="index.html">Francis Wall</a></li>
<li><a href="index.html">Graham Smith</a></li>
<li><a href="index.html">Greta Peete</a></li>
<li><a href="index.html">Harvey Walls</a></li>
<li><a href="index.html">Mike Farnsworth</a></li>
<li><a href="index.html">Murray Vanderbuilt</a></li>
<li><a href="index.html">Nathan Williams</a></li>
<li><a href="index.html">Paul Baker</a></li>
<li><a href="index.html">Pete Mason</a></li>
<li><a href="index.html">Rod Tarker</a></li>
<li><a href="index.html">Sawyer Wakefield</a></li>
</ul>
</div><!--/content-primary -->

<div class="content-secondary">

<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">

<h3>More in this section</h3>

<ul data-role="listview" data-theme="c" data-dividertheme="d">

<li data-role="list-divider">List views</li>
<li><a href="docs-lists.html">List markup conventions</a></li>
<li><a href="lists-ul.html">Basic linked list</a></li>
<li><a href="lists-nested.html">Nested list</a></li>
<li><a href="lists-ol.html">Numbered list</a></li>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li data-theme="a"><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
<li><a href="lists-formatting.html">Content formatting</a></li>
<li><a href="lists-search.html">Search filter bar</a></li>
<li><a href="lists-search-inset.html">Inset search filter bar</a></li>
<li><a href="lists-search-with-dividers.html">Search filter bar with dividers</a></li>

<li><a href="lists-readonly.html">Read-only lists</a></li>
<li><a href="lists-readonly-inset.html">Read-only inset lists</a></li>
<li><a href="lists-forms.html">Lists with forms</a></li>
<li><a href="lists-forms-inset.html">Inset lists with forms</a></li>

<li><a href="lists-inset.html">Inset styled lists</a></li>
<li><a href="lists-performance.html">List performance test</a></li>
<li><a href="lists-themes.html">Theming lists</a></li>

</ul>
</div>
</div>

</div><!-- /content -->

<div data-role="footer" class="footer-docs" data-theme="c">
<p>&copy; 2011 The jQuery Project</p>
</div>

</div><!-- /page -->

</body>
</html>
1 change: 1 addition & 0 deletions docs/lists/lists-count.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li data-theme="a"><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-divider.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li data-theme="a"><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-formatting.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-forms-inset.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li data-theme="a"><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-inset.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-ol.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-readonly-inset.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-readonly.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-search-inset.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-search-with-dividers.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-split.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ <h3>More in this section</h3>

<li data-theme="a"><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-themes.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-thumbnails.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li data-theme="a"><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/lists/lists-ul.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ <h3>More in this section</h3>

<li><a href="lists-split.html">Split button list</a></li>
<li><a href="lists-divider.html">List dividers</a></li>
<li><a href="lists-autodividers.html">Autodividers</a></li>
<li><a href="lists-count.html">Count bubble</a></li>
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
<li><a href="lists-icons.html">Icons</a></li>
Expand Down
1 change: 1 addition & 0 deletions js/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading