Event Listener for the Panel Widget

Hi there,

I’m using the panel widget for one of my projects. Whenever the panel is toggled (collapse / open) I’d like to be able to react to that with an event listener. Now my question is, does the panel widget fire an event? If so, where do I find the documentation about that?

If you need more info, let me know. Thanks for your suggestions!

Anyone? :slight_smile:

I don’t think there is any event fired but you can pass a collapsed function to the widgets. Have you tried firing the event from there? I think this will do what you want.

Please let me know!

Unfortunately the collapsed function only triggers once on page load and on every search refinement change. As far as I understand, the collapsed function is there to decide whether the panel should be collapsed or not. I would need something that triggers everytime a panel is collapsed or expanded manually by the user.

Hi aaron,
Indeed the collapsed function is not an event.
I see 2 solutions:

Hope this helps

1 Like

Hi @samuel.bodin,

Thank you for your suggestions. I’ll try to make it work with that and then I’ll let you know what worked best. :+1:

@samuel.bodin worked perfectly, thank you!

1 Like