0

To open a dialog (backup dialog) I am using the following link in my navigation menu:

<a href="backup" data-dialog=true>Backup</a>

In production this was just a temporary workaround which needs to be fixed in final release.

So, how can I open the dialog using a javascript function which is executed by the event bound to the modal's button?

event: function(){
    globalMsg("opening backup dialog", {level: 'info'});
    // TODO: Call <a href="backup" data-dialog=true>Backup</a>
}
albert
  • 8,027
  • 10
  • 48
  • 84
  • Which modal are we talking about? – lshettyl Jun 05 '15 at 12:35
  • There would be `display: block/none` in the dialog box. You can try `.show()` to the id of that dialog. Like if `dialogBox` is the id then try `$('#dialogBox').show()` – Ashwani Goyal Jun 05 '15 at 12:36
  • Doesn't `$("a[href='backup'][data-dialog='true']").click()` work? – blgt Jun 05 '15 at 12:44
  • @LShetty: Seems to be a jQuery UI dialog. Unfortunately, this is not my own project. Just need to adjust some stuff concerning user interaction. – albert Jun 05 '15 at 12:44
  • Also, jQueryUI dialogs are usually opened with `$(dialogSelector).dialog('open')` but can't say if that's possible from just the provided code – blgt Jun 05 '15 at 12:47
  • Possible duplicate of: [Passing data to a jQuery UI Dialog](http://stackoverflow.com/questions/394491/passing-data-to-a-jquery-ui-dialog) – Yogi Jun 05 '15 at 13:01
  • Further investigation pointed out that the used dialog is a self-written one. Sorry for the inconvenience... – albert Jun 05 '15 at 16:05

0 Answers0