diff --git a/js/widgets/filterable.js b/js/widgets/filterable.js index 888d830bdbc..5db7e3fad89 100644 --- a/js/widgets/filterable.js +++ b/js/widgets/filterable.js @@ -26,6 +26,7 @@ $.widget( "mobile.filterable", { filterCallback: defaultFilterCallback, enhanced: false, input: null, + ignore: null, children: "> li, > option, > optgroup option, > tbody tr, > .ui-controlgroup-controls > .ui-btn, > .ui-controlgroup-controls > .ui-checkbox, > .ui-controlgroup-controls > .ui-radio" }, @@ -92,7 +93,7 @@ $.widget( "mobile.filterable", { }, _filterItems: function( val ) { - var idx, callback, length, dst, + var idx, callback, length, dst, noFilter show = [], hide = [], opts = this.options, @@ -104,7 +105,8 @@ $.widget( "mobile.filterable", { // Partition the items into those to be hidden and those to be shown for ( idx = 0 ; idx < length ; idx++ ) { - dst = ( callback.call( filterItems[ idx ], idx, val ) ) ? hide : show; + noFilter = opts.ignore ? $( filterItems[ idx ] ).is( opts.ignore ) : false; + dst = ( !noFilter && callback.call( filterItems[ idx ], idx, val ) ) ? hide : show; dst.push( filterItems[ idx ] ); } }