gd-sprest-bs 10.8.4 → 10.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,41 @@ var Field = function (props) {
49
49
  });
50
50
  }
51
51
  }
52
+ // Parse the selected values
53
+ for (var i = 0; i < selectedValues.length; i++) {
54
+ var existsFl = false;
55
+ var selectedValue = selectedValues[i];
56
+ // Parse the items
57
+ for (var j = 0; j < items.length; j++) {
58
+ var itemValue = isCheckbox ? items[j]["label"] : items[j]["value"];
59
+ // See if the value exists
60
+ if (selectedValue == itemValue) {
61
+ // Set the flag
62
+ existsFl = true;
63
+ break;
64
+ }
65
+ }
66
+ // See if the item doesn't exist
67
+ if (!existsFl) {
68
+ // See if this is a checkbox
69
+ if (isCheckbox) {
70
+ // Add the item
71
+ items.push({
72
+ isSelected: true,
73
+ label: selectedValue
74
+ });
75
+ }
76
+ else {
77
+ // Add the item
78
+ items.push({
79
+ isSelected: true,
80
+ label: selectedValue,
81
+ text: selectedValue,
82
+ value: selectedValue
83
+ });
84
+ }
85
+ }
86
+ }
52
87
  // See if this is a dropdown and no selected values exists, and this is a required field
53
88
  if (!isCheckbox && items.length > 0 && selectedValues.length == 0 && field.Required) {
54
89
  // Select the first item
@@ -351,7 +351,8 @@ exports.ListForm.renderDisplayForm = function (props) {
351
351
  props.assignTo ? props.assignTo(form) : null;
352
352
  // Return the form informaiton
353
353
  return {
354
- get el() { return form ? form.el : null; }
354
+ get el() { return form ? form.el : null; },
355
+ getControl: function (fieldName) { return form ? form.getControl(fieldName) : null; }
355
356
  };
356
357
  };
357
358
  // Render the edit form