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

AUI Dialog event when dialog loaded/displayed

Michael Gray February 11, 2014

Is there an event for when an AUI dialog has loaded/displayed. I am wanting to execute some javascript after the dialog has displayed and the dialog elements are available. I am able to do this by adding a script tag in the template that is displayed in the dialog, but I thought there might be an event or a better approach. I saw the dialog 2 has a show event but it is still in an experimental state. Thanks!

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Michael Gray February 12, 2014

I was not able to get the "show.dialog" event to work. I'm probably doing something wrong. After doing some additional research I was able to get it to work (below) with info from:https://answers.atlassian.com/questions/58240/how-to-execute-javascript-in-popup-page

AJS.$(document).bind('dialogContentReady',   function(event, dialog) {
   console.log('dialog shown');
});

Is there a downside to using this approach?

0 votes
Boris Georgiev _Appfire_
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.
February 12, 2014

Here's a sample from the AUI.Dialog documentation at https://docs.atlassian.com/aui/latest/docs/dialog.html

AJS.bind("show.dialog", function(e, data) {
    console.log("Dialog shown " + data.dialog.id);
});

There are events for show/hide/remove

TAGS
AUG Leaders

Atlassian Community Events