From 6162129e3deb43690f6c0701d051b2dd5114a3ae Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 23 Jun 2021 23:36:38 +1000 Subject: [PATCH] Support choice field --- InvenTree/templates/js/forms.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index 6ca4f0560c..75b65fd885 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -193,6 +193,7 @@ function constructCreateForm(url, fields, options={}) { $(modal).modal('show'); attachToggle(modal); + attachSelect(modal); } @@ -318,7 +319,7 @@ function constructInput(name, parameters, options={}) { func = constructNumberInput; break; case 'choice': - // TODO: choice field + func = constructChoiceInput; break; case 'field': // TODO: foreign key field! @@ -440,6 +441,30 @@ function constructNumberInput(name, parameters, options={}) { } +// Construct a "choice" input +function constructChoiceInput(name, parameters, options={}) { + + var html = ``; + + return html; +} + + /* * Construct a 'help text' div based on the field parameters *