function updateRowsAggregation(oMode, iNewNumberOfRows) {
		const oTable = oMode.getTable();
		let aRows = oTable.getRows();

		if (aRows.length < iNewNumberOfRows) {
			// Create missing rows.
			const aNewRows = createRows(oTable, iNewNumberOfRows - aRows.length);

			aRows = aRows.concat(aNewRows);

			// Set the binding context before adding the new rows to the aggregation to avoid double propagation.
			updateBindingContextsOfRows(oMode, aRows);

			aNewRows.forEach(function(oNewRow) {
				oTable.addAggregation("rows", oNewRow, true);
			});
		} else {
			// Remove rows that are not required.
			for (let i = aRows.length - 1; i >= iNewNumberOfRows; i--) {
				oTable.removeAggregation("rows", i, true);
			}

			aRows.splice(iNewNumberOfRows);
			updateBindingContextsOfRows(oMode, aRows);
		}
	}
Updates the rows aggregation of the table. Updates the binding contexts of all rows and creates new rows if required.

@param {sap.ui.table.Table} oTable The table that is or will be the parent of the rows.
@param {int} iNewNumberOfRows The number of rows that need to be in the aggregation.