Trigger change after loading remote EntityRef default
authorColeman Watts <coleman@civicrm.org>
Sun, 20 Jul 2014 13:43:44 +0000 (14:43 +0100)
committerColeman Watts <coleman@civicrm.org>
Sun, 20 Jul 2014 13:43:44 +0000 (14:43 +0100)
js/Common.js

index b13ad4289c346ef4eb6aa2e6bf6005fcc35e4321..8b8b3f462572f328adcdb1ae955664890ca5fd62 100644 (file)
@@ -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');
             });
           }
         }