Frank7390035
Posts: 0
Joined: Thu Feb 19, 2015 1:37 am

How to close a modal from anywhere based on the modal name?

I have a modal that I'd like to close from a certain page. I need a way to reference this modal in order to close it
(e.g. modal.hide()).

Is there a way to reference it? e.g.

Apperyio.get('Modals').loadModal("trial").then( ...

Thank you,
FRANK

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to close a modal from anywhere based on the modal name?

Hello Frank,

There is no such a function because only one modal might be opened at the same time. So you can close only that modal.
Please save the instance of the modal to the global scope variable and close it with it's method hide():

premodal.hide();/pre

Return to “Issues”