----UPDATE 19.07.2013----
Hey Guys! I found out that the jquery.dataTables plugin I'm using is causing the error. When I comment-out the dataTable call, the gadget runs fine.
Here is the resources definition in atlassian-plugin.xml
<resource type="download" name="datatable/images/back_disabled.png" location="/datatable/images/back_disabled.png"/> <resource type="download" name="datatable/images/back_enabled_hover.png" location="/datatable/images/back_enabled_hover.png"/> <resource type="download" name="datatable/images/back_enabled.png" location="/datatable/images/back_enabled.png"/> <resource type="download" name="datatable/images/forward_disabled.png" location="/datatable/images/forward_disabled.png"/> <resource type="download" name="datatable/images/forward_enabled_hover.png" location="/datatable/images/forward_enabled_hover.png"/> <resource type="download" name="datatable/images/forward_enabled.png" location="/datatable/images/forward_enabled.png"/> <resource type="download" name="datatable/images/sort_asc_disabled.png" location="/datatable/images/sort_asc_disabled.png"/> <resource type="download" name="datatable/images/sort_asc.png" location="/datatable/images/sort_asc.png"/> <resource type="download" name="datatable/images/sort_both.png" location="/datatable/images/sort_both.png"/> <resource type="download" name="datatable/images/sort_desc_disabled.png" location="/datatable/images/sort_desc_disabled.png"/> <resource type="download" name="datatable/images/sort_desc.png" location="/datatable/images/sort_desc.png"/> <resource type="download" name="datatable/css/jquery.dataTables.css" location="/datatable/css/jquery.dataTables.css"/> <resource type="download" name="datatable/css/jquery.dataTables_themeroller.css" location="/datatable/css/jquery.dataTables_themeroller.css"/> <resource type="download" name="datatable/js/jquery.dataTables.min.js" location="/datatable/js/jquery.dataTables.min.js"/>
Somebody knows why dataTables makes this conflict with the jira javascripts??
I'm developing a gadget with atlassian development kit with a local jira instance, (v5.1.8#787-sha1:823790c).
In my local running jira, my gadget is running fine, but when I deploy it to our production jira(v5.2.11#854-sha1:ef00d61), I get the following javascript error messages:
In Chrome: "Uncaught TypeError: Cannot read property 'length' of undefined" in file "com.atlassian.auiplugin:jquery-lib.js:2"
In Firefox: "TypeError: a is undefined
..."resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b..." also in file "com.atlassian.auiplugin:jquery-lib.js:2"
The result is, that in the production jira dashboard, my gadget is completely empty. When I look into the firebug console, I see that my rest calls returns the correct data.
So the error occurs when I call the jquery functions to init the datatable.
I used a File diff tool and found only one big difference: In the production gadget.xml, my js-resources were packed into one file, called "[...]/download/batch/mygadget:resources/mygadget:resources.js"
But in my local jira the resources were loaded separately.
Thanks in advance
Community moderators have prevented the ability to post new answers.
It is a specific problem with jira 5.2.x I think, because it works with jira 5.1x.
The only solution is to include your own jquery-version(I used 1.8.3) and call the dataTable() function not with AJS.$ but with the jQuery object.
I am using DataTables with JIRA 7. Wen I call Datables() on jQuery, the tables gets created but after that error is shown (minified version: a is undefined).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are there any clashing id's in the combined file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How could I check that?
Because all is minified, and the bundled script is VERY LARGE, I'm a bit confused how to check for clashing id's.
Here is the original bundled javascript source: http://pastebin.com/m1LPJbqe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dataTable makes this conflict, but why....
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.