Hi all,
I see in the AUI Sandbow an example that triggers an inline dialog when a button is pressed:
AJS.InlineDialog(AJS.$("#popupLink"), 1, function(content, trigger, showPopup) { content.css({"padding":"20px"}).html('<h2>Inline dialog</h2><p>The inline dialog is a wrapper for secondary content/controls to be displayed on user request. Consider this component as displayed in context to the triggering control with the dialog overlaying the page content.</p><button class="aui-button">Done</button></form>'); showPopup(); return false; } );
But how to do to trigger this inline dialog from execution of a JS method?
Thanks,
Fred
Community moderators have prevented the ability to post new answers.
If you already have the trigger element you can just fire the click event yourself, eg in the aui sandbox example:
AJS.$("#popupLink").trigger('click')
Problem is that the trigger element is a button which should do something else than showing the dialog when clicked manually. So if I use .trigger('click'), then this will trigger its already defined function.
So, I need to be able to show the inline dialog, calling any method but trigger('click')...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you put the button inside a div, attach the inline dialog to the div, then trigger the click on the div...?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Click run, doesn't seem to work right on the initial load.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
Seems OK (it runs on initial load on my side), thank you for the tip!
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.