Hi,
I have a javascript to pre-populate value for my custom field based on user log in, it works perfectly fine until the user change the project which has different context of the field. For example, user log in is in "inhouse" group, "Client" custom field (select list) change to "inhouse" value, then if user select another project which has the same context, the value is still the same. However, if user select another project which has different context (different select list value), the "Client" field is reset and my script does not reload again. Please advise how can I reload the script whenever user select different project? window.onload doesn't work from my understanding.
Thanks,
For dinamically loaded elements you can use jQuery.on function or jQuery LiveQuery plugin that depends of your purposes
jQuery(document).on('click', 'your field selector', handlerFunction).
Plenty more you can find in this blog : http://api.jquery.com/on/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey, it looks than more clean way use this function :
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
...
});
Try it, this one resolve many problems with dynamic reloading.
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.