jsdoc.transactions_modal¶
File: biweeklybudget/flaskapp/static/js/transactions_modal.js
-
budgetSplitBlur
()¶ Triggered when a form element for budget splits loses focus. Calls
validateTransModalSplits()
and updates the warning div with the result.
-
transModal
(id, dataTableObj)¶ Show the Transaction modal popup, optionally populated with information for one Transaction. This function calls
transModalDivForm()
to generate the form HTML,transModalDivFillAndShow()
to populate the form for editing, andhandleForm()
to handle the Submit action (usingtransModalFormSerialize()
as a custom serialization function).Arguments: - id (number) – the ID of the Transaction to show a modal for, or null to show modal to add a new Transaction.
- dataTableObj (Object|null) – passed on to
handleForm()
-
transModalAddSplitBudget
()¶ Handler for the “Add Budget” link on trans modal when using budget split.
-
transModalBudgetSplitRowHtml
(row_num)¶ Generate HTML for a budget div inside the split budgets div.
Arguments: - row_num (Integer) – the budget split row number
-
transModalDivFillAndShow
(msg)¶ Ajax callback to fill in the modalDiv with data on a Transaction.
-
transModalDivForm
()¶ Generate the HTML for the form on the Modal
-
transModalFormSerialize
(form_id)¶ Custom serialization function passed to
handleForm()
for Transaction modal forms generated bytransModal()
. This handles serialization of Transaction forms that may have a budget split, generating data with abudgets
Object (hash/mapping/dict) with budget ID keys and amount values, suitable for passing directly toset_budget_amounts()
.Arguments: - form_id (String) – the ID of the form on the page.
-
transModalHandleSplit
()¶ Handler for change of the “Budget Split?” (
#trans_frm_is_split
) checkbox.
-
transModalSplitBudgetChanged
(row_num)¶ Called when a budget split dropdown is changed. If its amount box is empty, set it to the transaction amount minus the sum of all other budget splits.
Arguments: - row_num (Integer) – the budget split row number
-
validateTransModalSplits
()¶ Function to validate Transaction modal split budgets. Returns null if valid or otherwise a String error message.