Hi team,
I am trying to execute some code for Kanban boards. The code is working fine if I click a card and the issue details open up. However, this is not happening when the page is loaded. The best trigger I could find is the following:
AJS.toInit(funtion () {
myCodeGoesHere;
});
However, from the logging, all objects to be accessed are not available, so this seems to be too early.
In the browser logs, I could see a message like this:
callback: Finished callbacks for gh.work.pool.rendered
Is there a way to attach the execution of my code to this event? Or is there any Jira event that marks the completion of a board content?
Thanks!
Stefan
After doing investigation and researching, I have found a set of events specific for boards (Greenhopper), which work like a charme. This has been described in this thread:
In short, looking at the available events did the trick. Now, I can use the following code to trigger the modification whenever a column is updated:
(function ($) {
$(function () {
AJS.$(GH).bind('pool-column-updated', function (event, data) {
//my code goes here
});
});
})(AJS.$);
I hope this can help others as well.
Regards,
Stefan
Hi Stefan,
Typical startup of javascripts is when the DOM is loaded. You can achieve this using something similar to: stuff mentioned at stackoverflow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dick,
it is not enough to wait for the DOM to be loaded. This is already happening but the DOM in a Kanban board seems to be populated using JavaScript after this event is fired.
I have now tried using $(window).load but even with that, the jQuery selector return no elements, while it returns elements when clicking an issue so that the panelRefreshed Event is triggered.
So the question is more: Is there a way to figure out when the content of the board (i.e. the cards) are displayed?
Thanks for your help!
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.