1

I would like to open such a modal programmatically and then listen to events related to this modal (such as "option created", "option updated", "modal closed" etc). I tried to look at the CiviCRM source code but could not find API for that. Is there such a possibility?

enter image description here

2

It turned out to be possible:

CRM.loadForm('/some/url')
  .on('crmFormSuccess', function (event, data) {
    // do smth
});

Ref: https://docs.civicrm.org/dev/en/latest/framework/ajax/

| improve this answer | |
1

What are you trying to achieve exactly? Your solution works for the UI but will never catch any of the changes done via the API?

So if you want to just catch the UI actions, your solution will be fine. But if you want to catch all changes to an option group you might miss a few.

| improve this answer | |
  • Yes, I need to listen to changes via UI only. – igorpavlov Mar 27 '18 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.