Programming Tips - Bootstrap 4: event when a dialog is ready / closed

Date: 2024jan11 Language: javaScript Q. Bootstrap 4: event when a dialog is ready / closed A.
dlg.modal('show'); // The normal way to show a dialog dlg.modal('hide'); // The normal way to close a dialog dlg.on('shown.bs.modal', function() { console.log('my dialog is now shown to the user'); }); dlg.on('hidden.bs.modal', function() { console.log('my dialog was just closed - by the user or by me'); });