Let's say that I am following https://checkup.atlassian.com/server/jira/platform/tutorial-how-to-create-an-ajax-dialog-4227197/ and I want to add a select list to the dialog that we've created with AJS.FormPopup.
Easy, no problem, modify the .vm file and you're set.
What if you want to bind a function to the select list's change event?
How do you get this dialog to import JavaScript?
$webResourceManager.requireResource(), which works in other contexts, doesn't work here. CSS and JS files just don't get loaded.
Adding code to the javascript file you create in this tutorial doesn't work either, unless I'm doing something incredibly wrong by adding
$('#selector').change(function() {
//do stuff
});
How can I do this?
<script>
#include("/js/dialog-js.js")
</script>
works, but I kind of feel like there should be a better way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding resources to the jira.popup context appears to have no effect.
Creating a custom context appears to have no effect.
Is the only solution to include my javascript in a script tag?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.