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

Filterable: Add a data-no-filter attribute #8184

Open
carsonip opened this issue Jul 6, 2015 · 7 comments
Open

Filterable: Add a data-no-filter attribute #8184

carsonip opened this issue Jul 6, 2015 · 7 comments

Comments

@carsonip
Copy link

carsonip commented Jul 6, 2015

This is a feature request.
Add a data-no-filter attribute like this such that the list item will always show in both normal and reveal mode

<ul data-role="listview" data-filter="true" data-input="#filterBasic-input">
    <li data-no-filter="true">Acura</li>
    <li>Audi</li>
    <li>BMW</li>
    <li>Cadillac</li>
    <li>Ferrari</li>
</ul>

It is useful when we use a library like jqm-tinysort which inserts list items which are not intended for filtering.

People having the same problem:
http://stackoverflow.com/questions/14126115/jquery-mobile-how-to-prevent-the-header-row-of-a-list-view-from-getting-filtere

carsonip added a commit to carsonip/jquery-mobile that referenced this issue Jul 6, 2015
Add a data-no-filter attribute for an item such that it will always show under both normal and reveal mode.

Closes jquery-archivegh-8184
carsonip added a commit to carsonip/jquery-mobile that referenced this issue Jul 6, 2015
Add a data-no-filter attribute for an item such that it will always show in both normal and reveal mode when its data-no-filter="true"

Closes jquery-archivegh-8184
@arschmitz
Copy link
Contributor

@carsonip Thank you for the suggestion this is already easily possible you just need to use a custom filter callback. ( this was also already suggested in the stack overflow post ) You can see a working example here. http://jsbin.com/vatuwo/edit?html,js,output we generally don't add new options when the desired effect is something easily achieved through an existing option.

I will admit this seems like a general enough case i will leave this open for others to comment on though.

@carsonip
Copy link
Author

carsonip commented Jul 6, 2015

@arschmitz Thanks for the quick reply and you are right.

How about an item that will always show up in reveal mode (with unknown index)? I neither handled that. It will not show up when the content of search is empty. This does not seem to be easy without modifying the jQM code.

Would it be easier for users if we have something like a data-no-filter attribute?

@gabrielschulhof
Copy link

PR is #8185

@carsonip
Copy link
Author

carsonip commented Jul 7, 2015

@gabrielschulhof I have updated some code, should I make a new PR?

@apsdehal
Copy link
Contributor

apsdehal commented May 8, 2016

@carsonip @gabrielschulhof Any updates on this?

@carsonip
Copy link
Author

carsonip commented May 8, 2016

@apsdehal the PR is #8185 with the updates, I have not worked on this since Jul 11, 2015 tho. I thought @arschmitz said you guys will implement it in a different way. Actually is this now implemented?

@arschmitz
Copy link
Contributor

We still plan on doing this just not sure of exact implementation it will probably go into 1.6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants