Hi there,
I'm trying to add an additional close button to a dialog, but don't get it working. However, javascript is something new to me, and I'm probably doing a simple mistake....
My last try looks like this:
1<aui:script>
2
3function callPopup(){
4 AUI().ready('aui-dialog', function(A) {
5 var dialog = new A.Dialog({
6 title: 'dialog titele',
7 id: 'dialogId',
8 centered: true,
9 modal: true,
10 resizable: false,
11 width: 500,
12 height: 400,
13 draggable: false,
14 bodyContent: '<button type="button" onclick="dialogId.close()" value="close"></button>'
15 }).render();
16 });
17}
18
19callPopup();
20</aui:script>
This code is only executed in case the popup shall be shown, and showing the dialog works fine. However, closing it with the new button doesn't work. I think my problem is that I don't really know how to address the dialog in the onclick - or am I doing something completely wrong?
Thanks for your help,
Klaus
Please sign in to flag this as inappropriate.