fix for autopopulation

This commit is contained in:
jaredevantabor
2017-01-18 20:49:12 -08:00
parent 67f282f64d
commit 61ad4e3793
3 changed files with 56 additions and 19 deletions

View File

@@ -377,7 +377,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
applyDefaults: function (form, scope) {
// Note: This is a hack. Ideally, mode should be set in each <resource>-<mode>.controller.js
// The mode is needed by the awlookup directive to auto-populate form fields when there is a
// The mode is needed by the awlookup directive to auto-populate form fields when there is a
// single related resource.
scope.mode = this.mode;
@@ -1368,6 +1368,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += `data-basePath="${field.basePath}"`;
html += `data-source="${field.sourceModel}"`;
html += `data-query="?${field.sourceField}__iexact=:value"`;
html += (field.autopopulateLookup) ? `autopopulateLookup=${field.autopopulateLookup}` : "";
html += `ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 300, 'blur': 0 } }"`;
html += " awlookup >\n";
html += "</div>\n";