phenotips / open-pedigree

A free and open-source pedigree tool by PhenoTips®
GNU Lesser General Public License v2.1
46 stars 25 forks source link

Fire an event when a field has been updated #54

Closed AlgyTaylor closed 2 years ago

AlgyTaylor commented 2 years ago

Fire a pedigree:person:set:{field} event whenever a field is updated in the pedigree diagram.

This allows us to use code like below

document.observe('pedigree:person:set:externalid', (event) => {
  var demographics = getDemographics(event.memo.value);

  event.memo.node.setFirstName(demographics.firstName);
  event.memo.node.setLastName(demographics.lastName);
})

To automatically populate the pedigree diagram based on fields supplied by the user (where getDemographics is a custom function written by a third party).

buske commented 2 years ago

Thanks, @AlgyTaylor. This does seem helpful for integrating custom components.