commit c6f0f2b1087ccd0c5831dc4a0cfa350bfddff710
parent d4d1006f7f6937827825345003352eeea1f5113e
Author: Felicia Hummel <felicia@drachenkatze.org>
Date: Fri, 20 Dec 2019 19:02:27 +0100
Merge pull request #991 from ikcalB/partkeepr-989
fix #989: parameter info lost, selecting existing parameter
Diffstat:
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartParameterValueEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartParameterValueEditor.js
@@ -17,14 +17,15 @@ Ext.define("PartKeepr.PartParameterValueEditor", {
{
fieldLabel: i18n("Description"),
name: 'description',
+ itemId: 'description',
xtype: 'textarea'
},
{
xtype: 'UnitComboBox',
fieldLabel: i18n("Unit"),
+ name: 'unit',
itemId: "unit",
- returnObject: true,
- name: 'unit'
+ returnObject: true
},
{
fieldLabel: i18n("Value Type"),
@@ -111,6 +112,11 @@ Ext.define("PartKeepr.PartParameterValueEditor", {
},
onPartParameterSelect: function (combo, record) {
+ var description = record.get("description");
+ if (description !== null) {
+ this.down("#description").setRawValue(description);
+ }
+
if (record.get("unitName") !== null) {
var unit = this.down("#unit").getStore().findRecord("name", record.get("unitName"), 0, false, true, true);
@@ -118,7 +124,19 @@ Ext.define("PartKeepr.PartParameterValueEditor", {
this.down("#unit").select(unit);
this.down("#valueType").setValue({valueType: "numeric"});
}
+
+ } else {
+ this.down("#unit").select(null);
}
+
+ var valueType = record.get("valueType");
+ if (valueType == "numeric") {
+ this.down("#valueType").setValue({valueType: "numeric"});
+
+ } else if (valueType == "string") {
+ this.down("#valueType").setValue({valueType: "string"});
+ }
+
},
onUnitChange: function (combo, newValue) {
var prefixes,j, unitFilter = [];