Conditional select fields in panel with javascript?

Hi there,
i added a custom page blueprint with two select fields. Now i want to filter the second select field options based on the value of the first select. I think there is currently no easy “ajax way” with the default select fields? I know the new conditional fields but i only want to filter some options not the complete second field.
So the easiest solution i found so far is to filter the options of that second select with a javascript via a global on change event. So i added a custom js file to the panel with that event.
The main problem is now, when the user edits an existing page with an existing value for the first select, there is no “on change event” and so the second field shows all options.
So im searching for an event that triggers my filter function when the panel has finished creating the page form or a way to add a custom js function that is called after the panel shows the page form.

Do you have any ideas to achieve this or other ways for filtering the second field based on the value of the first one? Thank you!

Same here - this problem still exists. “when” option is not enough - more advanced mechanism is required.

You would need a custom field (or field group) where on field listens to changes of the first.