I’ve been trying to deploy the Jupyter interactive app to Open OnDemand with an added “version”-field. This way users can select their preferred version from the list of installed versions. This field is however dependent on which cluster they select as certain clusters may not have all versions available. What would be the best way to achieve this? One option would be to add some javascript to the page that checks for an update to the “cluster”-field and updates the “version”-field accordingly.
Welcome! I think JavaScript may be the only way to get the dynamic behavior you’re looking for. You could initialize everything the way you want but as soon as the user changes the cluster list the version list wouldn’t change.
Lets us know if you need help adding interactivity to forms! We’ve been chatting a lot about it lately in other topics.
Thanks for your answer. I’m trying to implement this with the html_options tag in form.yml.erb and adding an onchange javascript-function that filters the version list. This will probably work, but it isn’t ideal…
Is it possible to add javascript to to the HTML of the form without changing ood-code? I currently add <script>-tags to the help- and onload-fields in form.yml.erb. Is there a more clean way of doing this?
Yes, see this topic. You can simply add a form.js file in the same directory as the form.yml. You can also see the project on github that he’s linked in that topic as an example.
Actually while you could modify the form to include a cluster dropdown, the batch connect plugin currently doesn’t support this. We will address this limitation with an updated plugin architecture in the next 3-6 months.