Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Javascript at the close of a dialog box
Hello,
I acutallly use a dialog box and I want to execute some javascript at the close of the dialog.
To display the dialog box, I use that function
I acutallly use a dialog box and I want to execute some javascript at the close of the dialog.
To display the dialog box, I use that function
function showPopup(url,titre) {
AUI().use( 'aui-dialog', 'event', 'event-custom', function(A) {
dialog = new A.Dialog({
id: 'customDialog',
title: titre,
centered: true,
draggable: false,
resizable: false,
modal: true,
height:250,
width:650
}).plug(A.Plugin.IO, {uri: url}).render();
dialog.show();
});
}[code]
If someone knows how I can proceed.
Hi David,
Not master in AUI but hope following code will work for you.
Each dialog has closethick id for close button.
A.one('#closethick').on(click,function(){})
Regards,
Roshan
Not master in AUI but hope following code will work for you.
Each dialog has closethick id for close button.
A.one('#closethick').on(click,function(){})
Regards,
Roshan
Rightly said ! Using jquery you can fetch close button id and As roshan mentioned, you can define ur logic inside that function
Hi David,
You can try with following 2 options:
Option-1:
$('#dialog').live("dialogclose", function(){
//code to run on dialog close
});
Option-2:
There is on property available in AUI Diaplog named "beforeClose".
$("#dialog").dialog({
...
beforeClose: function(event, ui) {
console.log('Event Fire');
},
...
});
You can try with following 2 options:
Option-1:
$('#dialog').live("dialogclose", function(){
//code to run on dialog close
});
Option-2:
There is on property available in AUI Diaplog named "beforeClose".
$("#dialog").dialog({
...
beforeClose: function(event, ui) {
console.log('Event Fire');
},
...
});
If you use AUI, no jquery is required, would be too much...
See code below:
See code below:
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
var dialog = new A.Dialog({
on: {
close: function() {
window.alert('before close');
}
},
title: myTitle,
centered: false,
draggable: true,
modal: true
}).plug(A.Plugin.IO, {uri: renderUrl}).render();
dialog.show();
});
Community
Company
Feedback