simple filterCallback in the options to delegate complex search to end users

This commit is contained in:
John Bender 2011-08-03 17:10:44 -07:00
parent 2d7706a07b
commit 6bbf830da8

View file

@ -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 );