How get access to CornerstoneImageRendered event

192 views
Skip to first unread message

Alex Slobodyansky

unread,
Oct 10, 2017, 5:37:45 PM10/10/17
to cornerstone platform
Hello everyone!
When i add event listener on CornerstoneImageRendered event in imageViewerViewport file then my callback function starts but when i add event listener in another file(or i want create own package with this event) then my callback is not fire
How i can get access to cornerstone events?

Erik Ziegler

unread,
Nov 30, 2017, 11:34:53 AM11/30/17
to cornerstone platform
Hi Alex,

There is no reason you can't listen to events from outside the imageViewerViewport template. You just have to ensure that you are binding your event to the right element.

Meteor binds events in the template definitions and attaches them when the template is rendered. As long as you are attaching your event handler when the element actually exists, it should work fine.

Are you certain your element is rendered in the DOM at the time you are binding the event handler? Set a breakpoint and check that your element is actually in the page at the time of binding. I don't know if you can attach them from parent templates to listen to events from child templates. You might need to use something like Tracker.afterFlush.

Hope that helps,

Erik
Reply all
Reply to author
Forward
0 new messages