I would like to automatically refresh my datatables when the modalframe is closed. I saw the best way is to use the onbeforeunload module / event but I have no idea ho to find out if a modalframe is closed or the parent window. Is there a simple example somewhere or has anyone some hints or code how to find out if a modalframe is closed?

thx in advance for any help

Comments

dsnopek’s picture

Issue summary: View changes
Status: Active » Fixed

Actually, what you want to do is pass an 'onSubmit' function to Drupal.modalFrame.open() when opening your modal. That function will get called when the frame is closed. For example:

Drupal.modalFrame.open({
  // ... all the other arguments ...
  onSubmit: function (args, statusMessages) {
    // this will happen when the frame closes.
  }
});

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.