mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-17 06:20:26 +00:00
simple filterCallback in the options to delegate complex search to end users
This commit is contained in:
parent
2d7706a07b
commit
6bbf830da8
1 changed files with 4 additions and 1 deletions
|
|
@ -10,6 +10,9 @@
|
|||
$.mobile.listview.prototype.options.filter = false;
|
||||
$.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
|
||||
$.mobile.listview.prototype.options.filterTheme = "c";
|
||||
$.mobile.listview.prototype.options.filterCallback = function( text, searchValue ){
|
||||
return text.toLowerCase().indexOf( searchValue ) === -1;
|
||||
};
|
||||
|
||||
$( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
|
||||
|
||||
|
|
@ -70,7 +73,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
|
|||
// New bucket!
|
||||
childItems = false;
|
||||
|
||||
} else if ( itemtext.toLowerCase().indexOf( val ) === -1 ) {
|
||||
} else if ( listview.options.filterCallback( itemtext, val ) ) {
|
||||
|
||||
//mark to be hidden
|
||||
item.toggleClass( "ui-filter-hidequeue" , true );
|
||||
|
|
|
|||
Loading…
Reference in a new issue