this.invalidateNodes(); this.rowCount = inRowCount; // update page count, adjust document height oldPageCount = this.pageCount; this.pageCount = Math.ceil(this.rowCount / this.rowsPerPage); if(this.pageCount < oldPageCount){ for(var i=oldPageCount-1; i>=this.pageCount; i--){ this.height -= this.getPageHeight(i); delete this.pageHeights[i] } }else if(this.pageCount > oldPageCount){ this.height += this.defaultPageHeight * (this.pageCount - oldPageCount - 1) + this.calcLastPageHeight(); } this.resize();