Skip to content

Commit 3f4343d

Browse files
committed
Merge branch 'townxelliot-autodividers'
2 parents 8929eda + ca1bab2 commit 3f4343d

29 files changed

+592
-8
lines changed

docs/lists/docs-lists.html

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>List views</h2>
3434
</ul>
3535

3636
<h2>Basic linked lists</h2>
37-
<p>A list view is coded as a simple unordered list containing linked list items with a <code> data-role="listview"</code> attribute. jQuery Mobile will apply all the necessary styles to transform the list into a mobile-friendly list view with right arrow indicator that fills the full width of the browser window. When you tap on the list item, the framework will trigger a click on the first link inside the list item, issue an AJAX request for the URL in the link, create the new page in the DOM, then kick off a page transition. View the <a href="../api/data-attributes.html">data- attribute reference</a> to see all the possible attributes you can add to listviews.</p>
37+
<p>A list view is coded as a simple unordered list containing linked list items with a <code> data-role="listview"</code> attribute. jQuery Mobile will apply all the necessary styles to transform the list into a mobile-friendly list view with right arrow indicator that fills the full width of the browser window. When you tap on the list item, the framework will trigger a click on the first link inside the list item, issue an AJAX request for the URL in the link, create the new page in the DOM, then kick off a page transition. View the <a href="../api/data-attributes.html">data- attribute reference</a> to see all the possible attributes you can add to listviews.</p>
3838
<p>Here is the HTML markup for a basic linked list.</p>
3939

4040
<pre><code>
@@ -76,6 +76,31 @@ <h2>List dividers</h2>
7676
<a href="lists-divider.html" data-role="button" data-icon="arrow-r" data-iconpos="right">List divider example</a>
7777

7878

79+
<h2>Autodividers</h2>
80+
81+
<p>A listview can be configured to automatically generate dividers for its items. This is done by adding a <code>data-autodividers="true"</code> attribute to any listview.</p>
82+
83+
<p>By default, the text used to create dividers is the uppercased first letter of either the item's link text (for link lists) or the item's text (for read-only lists). Alternatively, if you are using formatted list items, you can specify divider text by setting the <code>autodividersSelector</code> option on the listview programmatically. For example, to add a custom selector to the element with <code>id="mylistview"</code>:</p>
84+
85+
<pre><code>
86+
$("#mylistview").listview({
87+
autodividers: true,
88+
89+
// the selector function is passed a &lt;li&gt; element from the listview;
90+
// it should return the appropriate divider text for that &lt;li&gt;
91+
// element as a string
92+
autodividersSelector: function ( li ) {
93+
var out = /* generate a string based on the content of li */;
94+
return out;
95+
}
96+
});
97+
</code></pre>
98+
99+
<p>If new list items are added to the list or removed from it, the dividers are <em>not</em> automatically updated: you should call <code>refresh()</code> on the listview to redraw the autodividers.</p>
100+
101+
<a href="lists-autodividers.html" data-role="button" data-icon="arrow-r" data-iconpos="right">Autodividers example</a>
102+
103+
79104
<h2>Search filter</h2>
80105
<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 <a href="../api/globalconfig.html">bind to the <code>mobileinit</code> event</a> 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>
81106

@@ -116,7 +141,7 @@ <h2>Inset lists</h2>
116141
<h2>Calling the listview plugin</h2>
117142
<p>You can directly call the listview plugin on any selector, just like any jQuery plugin:</p>
118143
<code>$('#mylist').listview();</code>
119-
144+
120145
<h2>Updating lists</h2>
121146
<p>If you add items to a listview, you'll need to call the <code>refresh()</code> method on it to update the styles and create any nested lists that are added. For example:</p>
122147
<code>$('#mylist').listview('refresh');</code>
@@ -142,6 +167,7 @@ <h3>More in this section</h3>
142167

143168
<li><a href="lists-split.html">Split button list</a></li>
144169
<li><a href="lists-divider.html">List dividers</a></li>
170+
<li><a href="lists-autodividers.html">Autodividers</a></li>
145171
<li><a href="lists-count.html">Count bubble</a></li>
146172
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
147173
<li><a href="lists-icons.html">Icons</a></li>
@@ -174,4 +200,3 @@ <h3>More in this section</h3>
174200

175201
</body>
176202
</html>
177-

docs/lists/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ <h1>Lists</h1>
3636

3737
<li><a href="lists-split.html">Split button list</a></li>
3838
<li><a href="lists-divider.html">List dividers</a></li>
39+
<li><a href="lists-autodividers.html">Autodividers</a></li>
3940
<li><a href="lists-count.html">Count bubble</a></li>
4041
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
4142
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-all-full.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ <h3>More in this section</h3>
140140

141141
<li><a href="lists-split.html">Split button list</a></li>
142142
<li><a href="lists-divider.html">List dividers</a></li>
143+
<li><a href="lists-autodividers.html">Autodividers</a></li>
143144
<li><a href="lists-count.html">Count bubble</a></li>
144145
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
145146
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-autodividers.html

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>jQuery Mobile Docs - List Dividers</title>
7+
<link rel="stylesheet" href="../../css/themes/default/" />
8+
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9+
<script src="../../js/jquery.js"></script>
10+
<script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
11+
<script src="../_assets/js/jqm-docs.js"></script>
12+
<script src="../../js/"></script>
13+
</head>
14+
<body>
15+
16+
<div data-role="page" class="type-interior">
17+
18+
<div data-role="header" data-theme="f">
19+
<h1>Autodividers</h1>
20+
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
21+
</div><!-- /header -->
22+
23+
<div data-role="content">
24+
<div class="content-primary">
25+
<ul data-role="listview" data-autodividers="alpha">
26+
<li><a href="index.html">Adam Kinkaid</a></li>
27+
<li><a href="index.html">Alex Wickerham</a></li>
28+
<li><a href="index.html">Avery Johnson</a></li>
29+
<li><a href="index.html">Bob Cabot</a></li>
30+
<li><a href="index.html">Caleb Booth</a></li>
31+
<li><a href="index.html">Christopher Adams</a></li>
32+
<li><a href="index.html">Culver James</a></li>
33+
<li><a href="index.html">David Walsh</a></li>
34+
<li><a href="index.html">Drake Alfred</a></li>
35+
<li><a href="index.html">Elizabeth Bacon</a></li>
36+
<li><a href="index.html">Emery Parker</a></li>
37+
<li><a href="index.html">Enid Voldon</a></li>
38+
<li><a href="index.html">Francis Wall</a></li>
39+
<li><a href="index.html">Graham Smith</a></li>
40+
<li><a href="index.html">Greta Peete</a></li>
41+
<li><a href="index.html">Harvey Walls</a></li>
42+
<li><a href="index.html">Mike Farnsworth</a></li>
43+
<li><a href="index.html">Murray Vanderbuilt</a></li>
44+
<li><a href="index.html">Nathan Williams</a></li>
45+
<li><a href="index.html">Paul Baker</a></li>
46+
<li><a href="index.html">Pete Mason</a></li>
47+
<li><a href="index.html">Rod Tarker</a></li>
48+
<li><a href="index.html">Sawyer Wakefield</a></li>
49+
</ul>
50+
</div><!--/content-primary -->
51+
52+
<div class="content-secondary">
53+
54+
<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
55+
56+
<h3>More in this section</h3>
57+
58+
<ul data-role="listview" data-theme="c" data-dividertheme="d">
59+
60+
<li data-role="list-divider">List views</li>
61+
<li><a href="docs-lists.html">List markup conventions</a></li>
62+
<li><a href="lists-ul.html">Basic linked list</a></li>
63+
<li><a href="lists-nested.html">Nested list</a></li>
64+
<li><a href="lists-ol.html">Numbered list</a></li>
65+
66+
<li><a href="lists-split.html">Split button list</a></li>
67+
<li><a href="lists-divider.html">List dividers</a></li>
68+
<li data-theme="a"><a href="lists-autodividers.html">Autodividers</a></li>
69+
<li><a href="lists-count.html">Count bubble</a></li>
70+
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
71+
<li><a href="lists-icons.html">Icons</a></li>
72+
<li><a href="lists-formatting.html">Content formatting</a></li>
73+
<li><a href="lists-search.html">Search filter bar</a></li>
74+
<li><a href="lists-search-inset.html">Inset search filter bar</a></li>
75+
<li><a href="lists-search-with-dividers.html">Search filter bar with dividers</a></li>
76+
77+
<li><a href="lists-readonly.html">Read-only lists</a></li>
78+
<li><a href="lists-readonly-inset.html">Read-only inset lists</a></li>
79+
<li><a href="lists-forms.html">Lists with forms</a></li>
80+
<li><a href="lists-forms-inset.html">Inset lists with forms</a></li>
81+
82+
<li><a href="lists-inset.html">Inset styled lists</a></li>
83+
<li><a href="lists-performance.html">List performance test</a></li>
84+
<li><a href="lists-themes.html">Theming lists</a></li>
85+
86+
</ul>
87+
</div>
88+
</div>
89+
90+
</div><!-- /content -->
91+
92+
<div data-role="footer" class="footer-docs" data-theme="c">
93+
<p>&copy; 2011 The jQuery Project</p>
94+
</div>
95+
96+
</div><!-- /page -->
97+
98+
</body>
99+
</html>

docs/lists/lists-count.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ <h3>More in this section</h3>
4949

5050
<li><a href="lists-split.html">Split button list</a></li>
5151
<li><a href="lists-divider.html">List dividers</a></li>
52+
<li><a href="lists-autodividers.html">Autodividers</a></li>
5253
<li data-theme="a"><a href="lists-count.html">Count bubble</a></li>
5354
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
5455
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-divider.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ <h3>More in this section</h3>
8080

8181
<li><a href="lists-split.html">Split button list</a></li>
8282
<li data-theme="a"><a href="lists-divider.html">List dividers</a></li>
83+
<li><a href="lists-autodividers.html">Autodividers</a></li>
8384
<li><a href="lists-count.html">Count bubble</a></li>
8485
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
8586
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-formatting.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ <h3>More in this section</h3>
101101

102102
<li><a href="lists-split.html">Split button list</a></li>
103103
<li><a href="lists-divider.html">List dividers</a></li>
104+
<li><a href="lists-autodividers.html">Autodividers</a></li>
104105
<li><a href="lists-count.html">Count bubble</a></li>
105106
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
106107
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-forms-inset.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ <h3>More in this section</h3>
215215

216216
<li><a href="lists-split.html">Split button list</a></li>
217217
<li><a href="lists-divider.html">List dividers</a></li>
218+
<li><a href="lists-autodividers.html">Autodividers</a></li>
218219
<li><a href="lists-count.html">Count bubble</a></li>
219220
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
220221
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-forms.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ <h3>More in this section</h3>
215215

216216
<li><a href="lists-split.html">Split button list</a></li>
217217
<li><a href="lists-divider.html">List dividers</a></li>
218+
<li><a href="lists-autodividers.html">Autodividers</a></li>
218219
<li><a href="lists-count.html">Count bubble</a></li>
219220
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
220221
<li><a href="lists-icons.html">Icons</a></li>

docs/lists/lists-icons.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ <h3>More in this section</h3>
5555

5656
<li><a href="lists-split.html">Split button list</a></li>
5757
<li><a href="lists-divider.html">List dividers</a></li>
58+
<li><a href="lists-autodividers.html">Autodividers</a></li>
5859
<li><a href="lists-count.html">Count bubble</a></li>
5960
<li><a href="lists-thumbnails.html">Thumbnails</a></li>
6061
<li data-theme="a"><a href="lists-icons.html">Icons</a></li>

0 commit comments

Comments
 (0)