tin-spa 2.8.1 → 2.8.2

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.
@@ -4426,15 +4426,17 @@ class FormComponent {
4426
4426
  inputChanged(field, value) {
4427
4427
  this.inputChange.emit({ field: field, value: value });
4428
4428
  this.updateChildOptions(field.name);
4429
- if (this.config.mode == 'create' && field.child) {
4430
- let child = this.fields.find(x => x.name == field.child.childField);
4431
- this.data[child.name] = field.options.find(x => x[field.optionValue] == value)[field.child.childValueField];
4432
- }
4433
4429
  if (this.config.mode == 'create' && field.children) {
4434
- console.log("Children found");
4430
+ console.log("Children found for master field ", field);
4431
+ console.log("Master value is ", value);
4435
4432
  field.children.forEach(childConfig => {
4436
4433
  let child = this.fields.find(x => x.name == childConfig.childField);
4437
- console.log("Child found");
4434
+ console.log("Child found ", child);
4435
+ console.log("Current data is ", this.data);
4436
+ console.log("Setting field ", child.name);
4437
+ console.log("Picked option is ", field.options.find(x => x[field.optionValue] == value));
4438
+ console.log("Set value is ", field.options.find(x => x[field.optionValue] == value)[childConfig.childValueField]);
4439
+ // this.data[child.name] = field.options.find(x => x[field.optionValue] == value)[childConfig.childValueField]
4438
4440
  this.data[child.name] = field.options.find(x => x[field.optionValue] == value)[childConfig.childValueField];
4439
4441
  });
4440
4442
  }