src/aria/templates/View.js
function () {
                var oldItems = this.items;
                var oldItemsLength = oldItems.length;
                var newItems = [];
                var initialArray = this.initialArray;

                if (ariaUtilsType.isObject(initialArray)) {
                    var oldItemsMap = new ariaUtilsStackHashMap();
                    var oldElt;
                    for (var i = 0; i < oldItemsLength; i++) {
                        oldElt = oldItems[i];
                        oldItemsMap.push(oldElt.value, oldElt);
                    }

                    var j = 0;
                    for (var p in initialArray) {
                        if (initialArray.hasOwnProperty(p) && !json.isMetadata(p)) {
                            newItems[j] = oldItemsMap.pop(initialArray[p]);
                            j++;
                        }
                    }
                    oldItemsMap.$dispose();
                } else {

                    for (var i = 0; i < oldItemsLength; i++) {
                        var elt = oldItems[i];
                        newItems[elt.initIndex] = elt;
                        delete oldItems[i];
                    }
                }
                this.items = newItems;
                var curState = this._currentState;
                curState.sortOrder = this.SORT_INITIAL;
                curState.sortName = null;
                curState.sortKeyGetter = null;
                this._changes = this._changes | this._CHANGED_PAGE_DATA;
            }
function () {
                var oldItems = this.items;
                var oldItemsLength = oldItems.length;
                var newItems = [];
                var initialArray = this.initialArray;

                if (ariaUtilsType.isObject(initialArray)) {
                    var oldItemsMap = new ariaUtilsStackHashMap();
                    var oldElt;
                    for (var i = 0; i < oldItemsLength; i++) {
                        oldElt = oldItems[i];
                        oldItemsMap.push(oldElt.value, oldElt);
                    }

                    var j = 0;
                    for (var p in initialArray) {
                        if (initialArray.hasOwnProperty(p) && !json.isMetadata(p)) {
                            newItems[j] = oldItemsMap.pop(initialArray[p]);
                            j++;
                        }
                    }
                    oldItemsMap.$dispose();
                } else {

                    for (var i = 0; i < oldItemsLength; i++) {
                        var elt = oldItems[i];
                        newItems[elt.initIndex] = elt;
                        delete oldItems[i];
                    }
                }
                this.items = newItems;
                var curState = this._currentState;
                curState.sortOrder = this.SORT_INITIAL;
                curState.sortName = null;
                curState.sortKeyGetter = null;
                this._changes = this._changes | this._CHANGED_PAGE_DATA;
            }
function ( ) { var oldItems = this . items ; var oldItemsLength = oldItems . length ; var newItems = [ ] ; var initialArray = this . initialArray ; if ( ariaUtilsType . isObject ( initialArray ) ) { var oldItemsMap = new ariaUtilsStackHashMap ( ) ; var oldElt ; for ( var i = 0 ; i < oldItemsLength ; i ++ ) { oldElt = oldItems [ i ] ; oldItemsMap . push ( oldElt . value , oldElt ) ; } var j = 0 ; for ( var p in initialArray ) { if ( initialArray . hasOwnProperty ( p ) && ! json . isMetadata ( p ) ) { newItems [ j ] = oldItemsMap . pop ( initialArray [ p ] ) ; j ++ ; } } oldItemsMap . $dispose ( ) ; } else { for ( var i = 0 ; i < oldItemsLength ; i ++ ) { var elt = oldItems [ i ] ; newItems [ elt . initIndex ] = elt ; delete oldItems [ i ] ; } } this . items = newItems ; var curState = this . _currentState ; curState . sortOrder = this . SORT_INITIAL ; curState . sortName = null ; curState . sortKeyGetter = null ; this . _changes = this . _changes | this . _CHANGED_PAGE_DATA ; }
Reset this.items to match the order of the initial array or map.
@protected
Reset this . items to match the order of the initial array or map .