src/aria/templates/View.js
function () {
                var items = this.items;
                var itemsLength = items.length;
                var pageSize = this.pageSize;
                if (pageSize <= 0) {
                    pageSize = -1;
                }
                var pages = [], pageLength = 0;
                var pageIndex = 0;
                var nbElementsInPage = 0;
                var firstElement = -1;
                for (var i = 0; i < itemsLength; i++) {
                    var elt = items[i];
                    if (elt.filteredIn) {
                        if (nbElementsInPage === 0) {
                            firstElement = i;
                        }
                        nbElementsInPage++;
                        elt.pageIndex = pageIndex;
                        if (nbElementsInPage == pageSize) {
                            pages[pageLength++] = {
                                pageIndex : pageIndex,
                                pageNumber : pageIndex + 1,
                                firstItemIndex : firstElement,
                                lastItemIndex : i,
                                firstItemNumber : pageIndex * pageSize + 1,
                                lastItemNumber : (pageIndex + 1) * pageSize
                            };
                            pageIndex++;
                            nbElementsInPage = 0;
                        }
                    } else {
                        elt.pageIndex = -1;
                    }
                }
                this._currentState.pageSize = pageSize;
                this.pageMode = (pageSize > 0);
                this.filteredInCount = pageIndex * pageSize + nbElementsInPage; // true even when pageMode == false (as
                // pageIndex == 0)
                if (nbElementsInPage > 0) {
                    pages[pageLength++] = {
                        pageIndex : pageIndex,
                        pageNumber : pageIndex + 1,
                        firstItemIndex : firstElement,
                        lastItemIndex : itemsLength - 1,
                        firstItemNumber : pageIndex * pageSize + 1,
                        lastItemNumber : this.filteredInCount
                    };
                }
                if (pageLength === 0) {
                    // there always must be at least one page
                    pages = this.EMPTY_PAGES;
                }
                this.pages = pages;
            }
function () {
                var items = this.items;
                var itemsLength = items.length;
                var pageSize = this.pageSize;
                if (pageSize <= 0) {
                    pageSize = -1;
                }
                var pages = [], pageLength = 0;
                var pageIndex = 0;
                var nbElementsInPage = 0;
                var firstElement = -1;
                for (var i = 0; i < itemsLength; i++) {
                    var elt = items[i];
                    if (elt.filteredIn) {
                        if (nbElementsInPage === 0) {
                            firstElement = i;
                        }
                        nbElementsInPage++;
                        elt.pageIndex = pageIndex;
                        if (nbElementsInPage == pageSize) {
                            pages[pageLength++] = {
                                pageIndex : pageIndex,
                                pageNumber : pageIndex + 1,
                                firstItemIndex : firstElement,
                                lastItemIndex : i,
                                firstItemNumber : pageIndex * pageSize + 1,
                                lastItemNumber : (pageIndex + 1) * pageSize
                            };
                            pageIndex++;
                            nbElementsInPage = 0;
                        }
                    } else {
                        elt.pageIndex = -1;
                    }
                }
                this._currentState.pageSize = pageSize;
                this.pageMode = (pageSize > 0);
                this.filteredInCount = pageIndex * pageSize + nbElementsInPage; // true even when pageMode == false (as
                // pageIndex == 0)
                if (nbElementsInPage > 0) {
                    pages[pageLength++] = {
                        pageIndex : pageIndex,
                        pageNumber : pageIndex + 1,
                        firstItemIndex : firstElement,
                        lastItemIndex : itemsLength - 1,
                        firstItemNumber : pageIndex * pageSize + 1,
                        lastItemNumber : this.filteredInCount
                    };
                }
                if (pageLength === 0) {
                    // there always must be at least one page
                    pages = this.EMPTY_PAGES;
                }
                this.pages = pages;
            }
function ( ) { var items = this . items ; var itemsLength = items . length ; var pageSize = this . pageSize ; if ( pageSize <= 0 ) { pageSize = - 1 ; } var pages = [ ] , pageLength = 0 ; var pageIndex = 0 ; var nbElementsInPage = 0 ; var firstElement = - 1 ; for ( var i = 0 ; i < itemsLength ; i ++ ) { var elt = items [ i ] ; if ( elt . filteredIn ) { if ( nbElementsInPage === 0 ) { firstElement = i ; } nbElementsInPage ++ ; elt . pageIndex = pageIndex ; if ( nbElementsInPage == pageSize ) { pages [ pageLength ++ ] = { pageIndex : pageIndex , pageNumber : pageIndex + 1 , firstItemIndex : firstElement , lastItemIndex : i , firstItemNumber : pageIndex * pageSize + 1 , lastItemNumber : ( pageIndex + 1 ) * pageSize } ; pageIndex ++ ; nbElementsInPage = 0 ; } } else { elt . pageIndex = - 1 ; } } this . _currentState . pageSize = pageSize ; this . pageMode = ( pageSize > 0 ) ; this . filteredInCount = pageIndex * pageSize + nbElementsInPage ; // true even when pageMode == false (as // pageIndex == 0) if ( nbElementsInPage > 0 ) { pages [ pageLength ++ ] = { pageIndex : pageIndex , pageNumber : pageIndex + 1 , firstItemIndex : firstElement , lastItemIndex : itemsLength - 1 , firstItemNumber : pageIndex * pageSize + 1 , lastItemNumber : this . filteredInCount } ; } if ( pageLength === 0 ) { // there always must be at least one page pages = this . EMPTY_PAGES ; } this . pages = pages ; }
Build this.pages array.
@protected
Build this . pages array .