How to write plugin code to trigger a workflow

So I am doing pretty well (re)writing my first plugin. I have finally got to the point where I just need to trigger a workflow when the user clicks on the element. I thought this would be pretty easy. I declared an event called in ‘clicked’ in the plugin editor and get a clicked option in the workflow option. But the editor says it’s my responsibility to define the event in the element code. Fair enough. I wrote:

$("#innermatte").on("click", function() {
console.log("innermatte clicked");
event.stopPropagation();
  bubble.clicked();
  });

I can see the click being seen in the console but how do I pass this event on to bubble? I know bubble.clicked() is garbage BTW! It’s just a placeholder for where I guess something is needed.

instance.triggerEvent('clicked');
3 Likes

Perfect. Thanks :slight_smile:

BTW, is there a secret stash of documentation for stuff like this?

There are a couple of places this information is available, the most immediate though happens to be on the same page your plugins code goes.

Huh, there it was, under my nose the whole time ! :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.