Is it possible to set publishing scope on calls to skuid.events.publish(event, data) ?
Hello I would like to publish an event to send data from a skuid aggregate model to a lightning component.
skuid.events.publish('AggMessage', JSON.stringify(payload));
AggMessage is never making it to the component listing on
<aura:handler event="skuid:event" action="{!c.handleSkuidEvent}"/>
I'm assuming this is because the publishing scope of AggMessage needs to be set to "All active pages and Lightning Components" How do I set event scope from code?
Thanks,
Peter
Tagged:
1
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
I made the event below with the builder with publish to Lightning Components scope and my component is receiving it. How do I add data payload to this event?
<action type="publish" scope="global" event="UpdateAggriate">
<params/>
</action>
Thanks,
Peter
My current approach is to listen for an event locally on the Skuid page (skuid.events.publish('some.event')) and to then use an event-triggered sequence in Skuid to listen to this and then publish another event via the action-framework to the surrounding Lightning Component using the broader scope.
This is working fine but it'd be nice to know how to publish to the broader scope straight from javascript rather than using the above two-step process. Any chance you could spill the beans on this?
Just a note - I also found that you had to set the even-triggered sequence to "All Active Pages and Lightning Components" for the above listener to work - even though the javascript was publishing the event from a snippet in the same Skuid page.