What is the version of JQuery in JIRA 4.4.3?
I added a custom subset from JQuery UI 1.8.7 to add autocomplete to a custom field which works, but the others JIRA javascript actions doesn't work anymore, could anyone help me?
The vm is roughly this:
<input id="$customField.id" name="$customField.id" type="text" /> <script type="text/javascript"><!-- jQuery(function() { jQuery( "#$customField.id" ).autocomplete({ source: function( request, response ) { jQuery.ajax({ url: "http://ws.geonames.org/searchJSON?name_startsWith=CALI&maxRows=5", dataType: "jsonp", success: function( data ) { response( jQuery.map( data, function( item ) { return { label: "test label", value: "test value" } })); } }); }, minLength: 2 }); }); //--></script>
The examples comes from the JQuery ufficial autocomplete plugin: http://jqueryui.com/demos/autocomplete/#remote-jsonp
Community moderators have prevented the ability to post new answers.
I finally found what JIRA use as javascript framework!
JIRA 4.4.3 uses Atlassian AUI 3.4.2 which uses JQuery 1.5.2 and JQuery UI 1.8.11.
In JQuery UI there are already:
To make JQuery Autocomplete work I added only:
In Firefox the autocomplete field works, but the other JIRA JS action doesn't and I get this error:
jQuery("form").handleAccessKeys is not a function
.../jira/s/it_IT-16bxfw/663/14/1/_/download/superbatch/js/batch.js
Line 298
In IE and Chrome everything works.
OK, I finally solved!!
The JQuery library used are correct, the problem was in Firefox that had cached the wrong version of JQuery!! Solved forcing the reload of the cache with CTRL+F5.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you need to know?
I used the JIRA JDK to develope a custom field plugin with the autocomplete and there is all in the question and my answers, do you need other info?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you find out which jQuery UI components are included in your version of Jira?
And how can I add new ones? I don't develope any plugin, I would just like to insert JavaScript code (in header.jsp for example) and use jquery autocomplete.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be using AJS.$ I think rather than jQuery, https://developer.atlassian.com/display/AUI/Getting+Started+with+AUI
If things dont work, start with a raw html page, firebug and alert('i got here') will help narrow down the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I learned this point (using AJS.$ in the global scope) the hard way; I would refrain from using jQuery() or $() in the global scope, although you should be able to do:
AJS.$(document).ready(function($){ $('#mySelector').doStuff(); });
Or:
AJS.$(document).ready(function(jQuery){ jQuery('#mySelector').doStuff(); });
See Aliasing the jQuery Namespace on the jQuery docs. Anybody doing this, though, should probably have a decent grasp of closure scope in Javascript.
Also, and this is just my own preference, console.log() is preferable to alert() for debugging while in the browser (with a browser that has console support, ie, Firebug, Chrome, and IE9, although IE's version isn't as good as the others; not sure about Safari).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.