src/aria/templates/View.js
function (filterType, filterCallback) {
                // normalize callback only once
                filterCallback = this.$normCallback(filterCallback);
                var filterFn = filterCallback.fn, filterScope = filterCallback.scope;
                // if not already done, we must first refresh the initial array before marking all elements:
                this._refreshInitialArray();
                var items = this.items;
                var itemsLength = items.length;
                for (var i = 0; i < itemsLength; i++) {
                    var elt = items[i];
                    var filteredIn = elt.filteredIn;
                    if (filterType == this.FILTER_SET || (filteredIn === (filterType == this.FILTER_REMOVE))) {
                        filteredIn = filterFn.call(filterScope, elt, filterCallback.args);
                        json.setValue(elt, "filteredIn", filteredIn);
                    }
                }
            }
function (filterType, filterCallback) {
                // normalize callback only once
                filterCallback = this.$normCallback(filterCallback);
                var filterFn = filterCallback.fn, filterScope = filterCallback.scope;
                // if not already done, we must first refresh the initial array before marking all elements:
                this._refreshInitialArray();
                var items = this.items;
                var itemsLength = items.length;
                for (var i = 0; i < itemsLength; i++) {
                    var elt = items[i];
                    var filteredIn = elt.filteredIn;
                    if (filterType == this.FILTER_SET || (filteredIn === (filterType == this.FILTER_REMOVE))) {
                        filteredIn = filterFn.call(filterScope, elt, filterCallback.args);
                        json.setValue(elt, "filteredIn", filteredIn);
                    }
                }
            }
function ( filterType , filterCallback ) { // normalize callback only once filterCallback = this . $normCallback ( filterCallback ) ; var filterFn = filterCallback . fn , filterScope = filterCallback . scope ; // if not already done, we must first refresh the initial array before marking all elements: this . _refreshInitialArray ( ) ; var items = this . items ; var itemsLength = items . length ; for ( var i = 0 ; i < itemsLength ; i ++ ) { var elt = items [ i ] ; var filteredIn = elt . filteredIn ; if ( filterType == this . FILTER_SET || ( filteredIn === ( filterType == this . FILTER_REMOVE ) ) ) { filteredIn = filterFn . call ( filterScope , elt , filterCallback . args ) ; json . setValue ( elt , "filteredIn" , filteredIn ) ; } } }
Filters the items with a callback function called on each element. Does not refresh the view.
@param {Integer} filterType Can be either FILTER_SET (in this case, filterCallback will be called on all elements
whether they are filtered in or not), FILTER_ADD (filterCallback will only be called on filtered out
elements, so that it can only add elements to the current display) or FILTER_REMOVE (filterCallback will
only be called on filtered in elements, so that it can only remove elements from the current display).
@param {aria.core.CfgBeans:Callback} filterCallback Callback which will be called on each item. The
callback must return either true or false, which will be the new value of the filteredIn property of the
element.
Filters the items with a callback function called on each element . Does not refresh the view .