Reputation: 21
if I have a value in data-filtertext, jQuery Mobile ignores the normal text of the row. Is there any way that the search filters the data-filtertext AND the normal text instead of only data-filtertext?
<li data-filtertext="value"><a href="#">content</a></li>
Upvotes: 2
Views: 1794
Reputation: 741
To my knowledge, there is currently no data-* option that allows both the data-filtertext and li content to be searched. Just combine the two of them together inside the data-filtertext string. Your example reworked:
<li data-filtertext="value content"><a href="#">content</a></li>
This works well in my case, where I list multiple sites within a city. The city name is a list-divider and not (usually) in the name of the site, but I want its sub-items to appear when it is typed in. Example:
<ul data-role='listview' data-filter='true'>
<li data-role="list-divider">Tallahassee</li>
<li data-filtertext="Tallahassee Dog Et Al">Dog Et Al</li>
<li data-filtertext="Tallahassee Jim and Milts">Jim and Milts</li>
<li data-role="list-divider">Atlanta</li>
<li data-filtertext="Atlanta The Varsity">The Varsity</li>
</ul>
Upvotes: 3