From 07cedd0549362d0c25ecea8d819af867147a5cd3 Mon Sep 17 00:00:00 2001 From: Cyrus Hiatt Date: Wed, 6 Nov 2024 10:51:39 -0800 Subject: [PATCH 1/2] Allow user to specify default value --- .../media/js/viewmodels/reference-select.js | 2 +- .../views/components/widgets/reference-select.htm | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arches_references/media/js/viewmodels/reference-select.js b/arches_references/media/js/viewmodels/reference-select.js index 6946d08..e2591b6 100644 --- a/arches_references/media/js/viewmodels/reference-select.js +++ b/arches_references/media/js/viewmodels/reference-select.js @@ -9,7 +9,7 @@ define([ var ReferenceSelectViewModel = function(params) { var self = this; - params.configKeys = ['placeholder']; + params.configKeys = ['placeholder', 'defaultValue']; this.multiple = !!ko.unwrap(params.node.config.multiValue); this.displayName = ko.observable(''); this.selectionValue = ko.observable([]); // formatted version of this.value that select2 can use diff --git a/arches_references/templates/views/components/widgets/reference-select.htm b/arches_references/templates/views/components/widgets/reference-select.htm index dfa9263..ee75a57 100644 --- a/arches_references/templates/views/components/widgets/reference-select.htm +++ b/arches_references/templates/views/components/widgets/reference-select.htm @@ -41,6 +41,18 @@ > +
+ +
+
+