src/aria/templates/View.js
function () {
                var curState = this._currentState;
                var initialArray = this.initialArray;
                var oldValues; // map of old values
                if (curState.initialArray == initialArray && !(this._changes & this.CHANGED_INITIAL_ARRAY)) {
                    return;
                }
                if (curState.initialArray) {
                    // there was already an array, let's keep its values
                    // to keep filteredInState when old values are reused
                    oldValues = new ariaUtilsStackHashMap();
                    var oldItems = this.items;
                    var oldItemsLength = oldItems.length, oldElt;
                    for (var i = 0; i < oldItemsLength; i++) {
                        oldElt = oldItems[i];
                        oldValues.push(oldElt.value, oldElt);
                    }
                }

                if (ariaUtilsType.isObject(initialArray)) {
                    var returnedItems = this._getItemsFromMap(oldValues);
                } else {
                    var returnedItems = this._getItemsFromArray(oldValues);
                }
                if (oldValues) {
                    this._removeListenersOnItems(oldValues.removeAll());
                    oldValues.$dispose();
                }
                this.items = returnedItems.items;
                var filteredOutElements = returnedItems.filteredOutElements;
                var arrayLength = this.items.length;
                curState.initialArray = initialArray;
                curState.sortOrder = this.SORT_INITIAL;
                curState.sortName = null;
                curState.sortKeyGetter = null;
                curState.pageSize = -1;
                this.filteredInCount = arrayLength - filteredOutElements;
                this.pages = [{ // page mode disabled: only one page
                    pageIndex : 0,
                    pageNumber : 1,
                    firstItemIndex : 0,
                    lastItemIndex : arrayLength - 1,
                    firstItemNumber : arrayLength > 0 ? 1 : 0,
                    lastItemNumber : this.filteredInCount
                }];
                this._changes = this._changes & !this.CHANGED_INITIAL_ARRAY; // don't add _CHANGED_PAGE_DATA because
                // we did the job here
            }
function () {
                var curState = this._currentState;
                var initialArray = this.initialArray;
                var oldValues; // map of old values
                if (curState.initialArray == initialArray && !(this._changes & this.CHANGED_INITIAL_ARRAY)) {
                    return;
                }
                if (curState.initialArray) {
                    // there was already an array, let's keep its values
                    // to keep filteredInState when old values are reused
                    oldValues = new ariaUtilsStackHashMap();
                    var oldItems = this.items;
                    var oldItemsLength = oldItems.length, oldElt;
                    for (var i = 0; i < oldItemsLength; i++) {
                        oldElt = oldItems[i];
                        oldValues.push(oldElt.value, oldElt);
                    }
                }

                if (ariaUtilsType.isObject(initialArray)) {
                    var returnedItems = this._getItemsFromMap(oldValues);
                } else {
                    var returnedItems = this._getItemsFromArray(oldValues);
                }
                if (oldValues) {
                    this._removeListenersOnItems(oldValues.removeAll());
                    oldValues.$dispose();
                }
                this.items = returnedItems.items;
                var filteredOutElements = returnedItems.filteredOutElements;
                var arrayLength = this.items.length;
                curState.initialArray = initialArray;
                curState.sortOrder = this.SORT_INITIAL;
                curState.sortName = null;
                curState.sortKeyGetter = null;
                curState.pageSize = -1;
                this.filteredInCount = arrayLength - filteredOutElements;
                this.pages = [{ // page mode disabled: only one page
                    pageIndex : 0,
                    pageNumber : 1,
                    firstItemIndex : 0,
                    lastItemIndex : arrayLength - 1,
                    firstItemNumber : arrayLength > 0 ? 1 : 0,
                    lastItemNumber : this.filteredInCount
                }];
                this._changes = this._changes & !this.CHANGED_INITIAL_ARRAY; // don't add _CHANGED_PAGE_DATA because
                // we did the job here
            }
function ( ) { var curState = this . _currentState ; var initialArray = this . initialArray ; var oldValues ; // map of old values if ( curState . initialArray == initialArray && ! ( this . _changes & this . CHANGED_INITIAL_ARRAY ) ) { return ; } if ( curState . initialArray ) { // there was already an array, let's keep its values // to keep filteredInState when old values are reused oldValues = new ariaUtilsStackHashMap ( ) ; var oldItems = this . items ; var oldItemsLength = oldItems . length , oldElt ; for ( var i = 0 ; i < oldItemsLength ; i ++ ) { oldElt = oldItems [ i ] ; oldValues . push ( oldElt . value , oldElt ) ; } } if ( ariaUtilsType . isObject ( initialArray ) ) { var returnedItems = this . _getItemsFromMap ( oldValues ) ; } else { var returnedItems = this . _getItemsFromArray ( oldValues ) ; } if ( oldValues ) { this . _removeListenersOnItems ( oldValues . removeAll ( ) ) ; oldValues . $dispose ( ) ; } this . items = returnedItems . items ; var filteredOutElements = returnedItems . filteredOutElements ; var arrayLength = this . items . length ; curState . initialArray = initialArray ; curState . sortOrder = this . SORT_INITIAL ; curState . sortName = null ; curState . sortKeyGetter = null ; curState . pageSize = - 1 ; this . filteredInCount = arrayLength - filteredOutElements ; this . pages = [ { // page mode disabled: only one page pageIndex : 0 , pageNumber : 1 , firstItemIndex : 0 , lastItemIndex : arrayLength - 1 , firstItemNumber : arrayLength > 0 ? 1 : 0 , lastItemNumber : this . filteredInCount } ] ; this . _changes = this . _changes & ! this . CHANGED_INITIAL_ARRAY ; // don't add _CHANGED_PAGE_DATA because // we did the job here }
Creates this.items corresponding to this.initialArray. It reuses the current this.items elements if
possible.
@protected
Creates this . items corresponding to this . initialArray . It reuses the current this . items elements if possible .