Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I refresh a gadget with javascript?

Anthony Madray August 15, 2011

I have a gadget that display and allows updates of issue informations (these updates are made by Ajax post calls (AJS.$.post(.....)) .

I would like to refresh my gadget view to see these updates, by some javascript function.

As there is no "refresh()" function in the gadget API, I tried the resize() function with the "onResizeReload: true" option activated but it doesn't seem to work.

Any idea?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Anthony Madray August 16, 2011

Ok I found, this do the reload:

gadget.showView(true);

To resize after reload :
//JRADEV-3464: Resizing the gadget after a considerable timeout to make sure bottom isn't cutoff

setTimeout(function() {gadget.resize();}, 500);

Daniel Faba
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 19, 2016

Thanks. That helped me.

Chris Stamp February 16, 2016

This is  an old fix. Atlassian needs to create a better mechanism to do this as third party plugins are created dynamically at times  and need a dom refresh. Good Answer I found this as as well albeit a workaround 

0 votes
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2011

Can't you just update the DOM with your JavaScript?

TAGS
AUG Leaders

Atlassian Community Events