You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
The listview filter proceeds to do a character by character filter, which is only useful in very limited number of cases. It doesn't work if all products have reg or tm symbols in them or have long names.
Self-edited rant about lack of low-level documentation here... uneccessary
I actually closed it because I felt I had been a bit too harsh about the
documentation thing. We're actually using jquery mobile to build a mobile
site for/at a major company that everybody knows, and in those kinds of
cases as you probably know there is little design/functionality flexibility,
so we have all been experiencing a bit of frustration at the lack of more
detailed documentation. I feel there must be a lot of functionality that
could be hooked into, and styling that can be overriden that we're missing.
I will go ahead and make it into a feature request, and I'll be nice about
it :)
Thanks Jason, I appreciate it! We're a tiny team working on this so features like this aren't as fleshed out right now as we'd all like. If you do figure out a clean way to make this extensible, please submit a patch.
So I'm not really familiar with git and submitting patches (been stuck in the svn world), but I have a simple working method to skip any non-alphanumeric characters within the "listview" filter extension that can be enabled by adding data-filter-skipspecial="true" to your listview ul.
It defaults to false:
$.mobile.listview.prototype.options.filterSkipspecial = false;
but if set true does a replace on both input value and "itemtext" with the following:
.replace(/[^a-zA-Z 0-9]+/g,'').replace(/\s+/g,' ');
which only compares like strings containing alphanumeric characters, and without excess whitespace as might be added by removing an ampersand or another character that might stand alone. The character itself can still be typed in without effect, as the compared input string is still filtered.
It might be nice to give developers the option to specify an array of allowed or filtered characters, but I think this would suit our needs for now.
My thought on this is that instead of creating a special case for this one situation, we'd be better off having a pluggable solution that lets' people use whatever parsing logic they want. I can see the current approach ballooning as people want to add scoping and more complex searching logic.
This has been solved by adding a callback allowing one to intercept the filter term: #2216
Unfortunately another unrelated issue (#2092) that can't easily be solved using this hook was closed instead. Can we keep that one open and close the appropriate one (this)?
Activity
toddparker commentedon Jun 24, 2011
This is a good feature request...would you mind adding it to the feature request wiki page?
project707 commentedon Jun 24, 2011
I actually closed it because I felt I had been a bit too harsh about the
documentation thing. We're actually using jquery mobile to build a mobile
site for/at a major company that everybody knows, and in those kinds of
cases as you probably know there is little design/functionality flexibility,
so we have all been experiencing a bit of frustration at the lack of more
detailed documentation. I feel there must be a lot of functionality that
could be hooked into, and styling that can be overriden that we're missing.
I will go ahead and make it into a feature request, and I'll be nice about
it :)
Thanks,
jason
On Fri, Jun 24, 2011 at 12:29 PM, toddparker <
reply@reply.github.com>wrote:
toddparker commentedon Jun 24, 2011
Thanks Jason, I appreciate it! We're a tiny team working on this so features like this aren't as fleshed out right now as we'd all like. If you do figure out a clean way to make this extensible, please submit a patch.
project707 commentedon Jun 28, 2011
So I'm not really familiar with git and submitting patches (been stuck in the svn world), but I have a simple working method to skip any non-alphanumeric characters within the "listview" filter extension that can be enabled by adding data-filter-skipspecial="true" to your listview ul.
It defaults to false:
$.mobile.listview.prototype.options.filterSkipspecial = false;
but if set true does a replace on both input value and "itemtext" with the following:
.replace(/[^a-zA-Z 0-9]+/g,'').replace(/\s+/g,' ');
which only compares like strings containing alphanumeric characters, and without excess whitespace as might be added by removing an ampersand or another character that might stand alone. The character itself can still be typed in without effect, as the compared input string is still filtered.
It might be nice to give developers the option to specify an array of allowed or filtered characters, but I think this would suit our needs for now.
project707 commentedon Jul 1, 2011
I have added this feature to a branch and submitted a pull request.
Sorry for the branch naming convention. I was following https://gist.github.com/726275 instructions and being a gitN00b just followed along exactly.
toddparker commentedon Jul 6, 2011
Pull request here:
https://github.com/project707/jquery-mobile/commit/994f69ce85f40ed54f9ba5ca5d41f198fd4b077a
My thought on this is that instead of creating a special case for this one situation, we'd be better off having a pluggable solution that lets' people use whatever parsing logic they want. I can see the current approach ballooning as people want to add scoping and more complex searching logic.
project707 commentedon Aug 19, 2011
This has been solved by adding a callback allowing one to intercept the filter term:
#2216
Unfortunately another unrelated issue (#2092) that can't easily be solved using this hook was closed instead. Can we keep that one open and close the appropriate one (this)?
toddparker commentedon Aug 19, 2011
Thanks, closing this, will reopen #2092