Announcement

Collapse
No announcement yet.

How do I use custom triggers?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I use custom triggers?

    I am adding a custom button to a view (in /modals/duplicate.js) and would like to trigger a custom event to be handled by the parent code (/record/detail.js) that subscribes to it.

    In my button's click handler I do this:
    Code:
    this.trigger('customEvent');
    In the parent view I did
    Code:
    this.listenToOnce(view, 'customEvent', function () {/*... code ... */}
    But it did not work. Is there some documentation I am missing?

  • #2
    Make sure that view is defined
    and u can try
    view.on('customEvent',function(){/*... code ... */} )
    Eymen Elkum - Ebla Soft
    ==========================
    wtsapp | 905366891649
    skype | 905366891649
    email | eymen@ebla-soft.com

    Comment


    • #3
      Thanks, the view is defined since I was just adding to espo's original code in record/detail.js. I will try the "view.on()" method.

      Comment

      Working...
      X