Page 1 of 1

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

Posted: Sun Dec 17, 2017 6:48 pm
by Frank7390035

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


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

Posted: Mon Dec 18, 2017 5:12 pm
by Serhii Kulibaba

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