src/aria/templates/View.js
function (oldValues) {
                var initialArray = this.initialArray;
                var items = [];
                var filteredOutElements = 0;
                var arrayLength = initialArray.length;
                for (var i = 0; i < arrayLength; i++) {
                    var iaElt = initialArray[i];
                    var itemsElt = null;
                    if (oldValues) {
                        itemsElt = oldValues.pop(iaElt);
                    }
                    if (itemsElt == null) {
                        if (iaElt != null) {
                            itemsElt = {
                                value : iaElt,
                                initIndex : i,
                                filteredIn : true,
                                sortKey : null,
                                pageIndex : 0
                            };

                            json.addListener(itemsElt, "filteredIn", this._jsonChangeCallback, true);
                        } else {
                            // log an error if iaElt is undefined
                            this.$logError(this.UNDEFINED_ARRAY_ELEMENT);
                        }

                    } else {
                        itemsElt.pageIndex = 0;
                    }
                    if (itemsElt) {
                        items[i] = itemsElt;
                        if (!itemsElt.filteredIn) {
                            filteredOutElements++;
                        }
                    }
                }
                return {
                    items : items,
                    filteredOutElements : filteredOutElements
                };

            }
function (oldValues) {
                var initialArray = this.initialArray;
                var items = [];
                var filteredOutElements = 0;
                var arrayLength = initialArray.length;
                for (var i = 0; i < arrayLength; i++) {
                    var iaElt = initialArray[i];
                    var itemsElt = null;
                    if (oldValues) {
                        itemsElt = oldValues.pop(iaElt);
                    }
                    if (itemsElt == null) {
                        if (iaElt != null) {
                            itemsElt = {
                                value : iaElt,
                                initIndex : i,
                                filteredIn : true,
                                sortKey : null,
                                pageIndex : 0
                            };

                            json.addListener(itemsElt, "filteredIn", this._jsonChangeCallback, true);
                        } else {
                            // log an error if iaElt is undefined
                            this.$logError(this.UNDEFINED_ARRAY_ELEMENT);
                        }

                    } else {
                        itemsElt.pageIndex = 0;
                    }
                    if (itemsElt) {
                        items[i] = itemsElt;
                        if (!itemsElt.filteredIn) {
                            filteredOutElements++;
                        }
                    }
                }
                return {
                    items : items,
                    filteredOutElements : filteredOutElements
                };

            }
function ( oldValues ) { var initialArray = this . initialArray ; var items = [ ] ; var filteredOutElements = 0 ; var arrayLength = initialArray . length ; for ( var i = 0 ; i < arrayLength ; i ++ ) { var iaElt = initialArray [ i ] ; var itemsElt = null ; if ( oldValues ) { itemsElt = oldValues . pop ( iaElt ) ; } if ( itemsElt == null ) { if ( iaElt != null ) { itemsElt = { value : iaElt , initIndex : i , filteredIn : true , sortKey : null , pageIndex : 0 } ; json . addListener ( itemsElt , "filteredIn" , this . _jsonChangeCallback , true ) ; } else { // log an error if iaElt is undefined this . $logError ( this . UNDEFINED_ARRAY_ELEMENT ) ; } } else { itemsElt . pageIndex = 0 ; } if ( itemsElt ) { items [ i ] = itemsElt ; if ( ! itemsElt . filteredIn ) { filteredOutElements ++ ; } } } return { items : items , filteredOutElements : filteredOutElements } ; }
Build the items array starting from the initial array and taking into account the items that are already
present in the items array of the view
@protected
@param {aria.utils.StackHashMap} oldValues map of the items that are already present in the items array,
indexed by item value
@return {Object} contains the items array and the number of elements that are filtered out
Build the items array starting from the initial array and taking into account the items that are already present in the items array of the view