Commit 94c23a93 authored by jaapjansma's avatar jaapjansma
Browse files

Merge branch 'restoredefaults' into 'master'

Show selected values in formprocessor defaults

See merge request !19
parents 1cac9afa 293ed9a9
......@@ -213,6 +213,14 @@
});
};
$scope.restoreDefault = function(value,key){
// checks if the old value of the select list is still in the range
// of options. If so restore it
if($scope.default_data_fields.find(field => field.name===value)) {
$scope.formProcessor.default_data_output_configuration[key] = value;
}
}
});
})(angular, CRM.$, CRM._);
......@@ -11,14 +11,13 @@
<td>{{input.name}}</td>
<td>
<select class="huge40"
crm-ui-id="defaultDataOutput.default_data_output_configuration[input.name]"
name="type"
ui-jq="select2"
ui-options="{dropdownAutoWidth : true, allowClear: true}"
name="{{input.name}}"
crm-ui-id="defaultData.{{input.name}}"
crm-ui-select="{dropdownAutoWidth : true, allowClear: true}"
ng-model="formProcessor.default_data_output_configuration[input.name]"
ng-change="restoreDefault('{{formProcessor.default_data_output_configuration[input.name]}}',input.name)"
ng-required="false"
ng-options="field.name as field.label for field in default_data_fields"
ng-options="field.name as field.label for field in default_data_fields track by field.name"
>
<option value="">{{ts('- Select field to add to the output -')}}</option>
</select>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment