Is there a way to set the context when publishing an event via JS

I’m working on the drag and drop in skuid labs, and would like to make it a bit more reusable by publishing an event when an element is dropped that the builder could connect to. I feel like there must be a way but I haven’t found any options.

For example, if I drag and drop OpportunityA from Ready → In Progress, I could publish an event drop.inprogress and have a listener in the builder that runs a row update action to change the status. I could also publish drop.closed when it is moved to Closed that has a modal to select Closed Won, Closed Lost, modify the date, etc since it’s a more complex state change.

1 Like

That would be a very elegant approach. When I did the kanban drag/drop experiment, I just grab the status of the element next to it to determine the new status.

I feel like I’m missing something from your question, and if you can share your XML, I can experiment as well. But you can pass data along when publishing an event based on docs on event publishing. How about publishing the event with the id of the row for context, so something like drake.on(drop, skuid.events.publish('drop.inprogress', [rowId]);) where rowId is the id of row that you extract from the drag portion of the code.