From 366a2d57c3d4eecd221beef43fc49c04b4b51aac Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 2 Jul 2021 19:27:19 +1000 Subject: [PATCH] Improve docstring --- InvenTree/templates/js/forms.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index 1faab4f9ab..e06bd5a0d4 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -223,11 +223,24 @@ function constructDeleteForm(fields, options) { * Request API OPTIONS data from the server, * and construct a modal form based on the response. * + * url: API URL which defines form data * options: - * - method: The HTTP method e.g. 'PUT', 'POST', 'DELETE', + * - method: The HTTP method e.g. 'PUT', 'POST', 'DELETE' (default='PATCH') * - title: The form title - * - fields: list of fields to display - * - exclude: List of fields to exclude + * - fields: list of fields to display, with the following options + * - filters: API query filters + * - onEdit: callback when field is edited + * - secondary: Define a secondary modal form for this field + * - label: Specify custom label + * - help_text: Specify custom help_text + * - value: Specify initial value + * - hidden: Set to true to hide the field + * - icon: font-awesome icon to display before the field + * - prefix: Custom HTML prefix to display before the field + * - onSuccess: callback function + * - confirm: Set to true to require a "confirm" button + * - confirmText: Text for confirm button (default = "Confirm") + * */ function constructForm(url, options) {