From: Coleman Watts Date: Sun, 20 Jul 2014 13:43:44 +0000 (+0100) Subject: Trigger change after loading remote EntityRef default X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d2b4810bd77b09bb5d51fc07ba0aadfd82673df7;p=civicrm-core.git Trigger change after loading remote EntityRef default --- diff --git a/js/Common.js b/js/Common.js index b13ad4289c..8b8b3f4625 100644 --- a/js/Common.js +++ b/js/Common.js @@ -367,7 +367,9 @@ CRM.strings = CRM.strings || {}; } else { var params = $.extend({}, $el.data('api-params') || {}, {id: val}); CRM.api3($el.data('api-entity'), 'getlist', params).done(function(result) { - callback(multiple ? result.values : result.values[0]) + callback(multiple ? result.values : result.values[0]); + // Trigger change (store data to avoid an infinite loop of lookups) + $el.data('entity-value', result.values).trigger('change'); }); } }