Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Document data-filtertext attribute

  • Loading branch information...
commit 37499c4df9275b8f24dea2f445141deb1dd244f9 1 parent 47cf8d6
Jake Boone jakeboone02 authored
Showing with 8 additions and 6 deletions.
  1. +4 −0 docs/api/data-attributes.html
  2. +4 −6 docs/lists/docs-lists.html
4 docs/api/data-attributes.html
View
@@ -291,6 +291,10 @@
<p>LI within a listview</p>
<table>
<tr>
+ <th>data-filtertext</th>
+ <td>string (filter by this value instead of inner text)</td>
+ </tr>
+ <tr>
<th>data-icon</th>
<td>home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search</td>
</tr>
10 docs/lists/docs-lists.html
View
@@ -73,13 +73,11 @@
<p>If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining <code>$.mobile.listview.prototype.options.filterCallback</code> during <code>mobileinit</code> or after the widget has been created with <code>$("#mylist").listview('option', 'filterCallback', yourFilterFunction)</code>. Any function defined for the callback will be provided two arguments. First, the text of the current list item and second, the value being searched for. A truthy value will result in a hidden list item. The default callback which filters entries without the <code>searchValue</code> as a substring is described below:
</p>
- <pre>
- <code>
-function( text, searchValue ){
+<pre><code>function( text, searchValue ){
return text.toLowerCase().indexOf( searchValue ) === -1;
-};
- </code>
- </pre>
+};</code></pre>
+
+ <p>To filter list items by values other than the text, add a <code>data-filtertext</code> attribute to the list item. The value of this attribute will be passed as the first argument to the <code>filterCallback</code> function instead of the text.</p>
<h2>Text formatting &amp; counts</h2>
<p>The framework includes text formatting conventions for common list patterns like header/descriptions, secondary information and counts through semantic HTML markup.</p>
Please sign in to comment.
Something went wrong with that request. Please try again.