Class: View

View(storage)

Class for displaying html templates and content.

Constructor

new View(storage)

Parameters:
Name Type Description
storage Storage Storage object.
Source:

Methods

capFirstLetter(str)

Capitalizes the first letter of a word.
Parameters:
Name Type Description
str string The word which should be capitalized.
Source:

createDatepicker(id, elems, minDateopt)

Creates a datepicker on a given dom element.
Parameters:
Name Type Attributes Default Description
id string The id of the dom element.
elems array Array of three inputs (year, month, day) in which the chosen value will be displayed.
minDate Date <optional>
null Minimum date which can be selected.
Source:

elt(type, attrs, …children)

Creates a new dom element.
Parameters:
Name Type Attributes Description
type string The type of the new element (e.g. h1, p, div).
attrs object Attributes of the new element (e.g. {class: 'someClass'}).
children any <repeatable>
Children of the new element (either more dom elements or the text of the new element).
Source:

printNum(num) → {string}

Returns the string representation of a number for displaying it. (The display version has two decimal places and a currency sign)
Parameters:
Name Type Description
num number The number which should be displayed.
Source:
Returns:
The display representation of that number.
Type
string

sortTableByColumn(table, n)

Inspired by https://www.w3schools.com/howto/howto_js_sort_table.asp. Sorts a table by a given column id.
Parameters:
Name Type Description
table string The id of the table.
n number The number which specifies the column to sort by: 0: Date 1: Name 2: Sum 3: Category 4: Budget 5: Type
Source:

updateLang(lang)

Updates the currently selected language.
Parameters:
Name Type Description
lang string The new language.
Source:

updateView()

Updates the view.
Source: