ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to close a Popup or PopupForm when a hyperlink inside it is clicked
Title:
B
I
{code}
?
My ultimate aim is to create a dropdown menu, which contains hyperlinks like Edit, Delete, Copy, etc. My problem is that when the hyperlinks are clicked, the Popup\PopupForm doesn't know to close directly afterwards. If I use PopupForm's Success callback, I could use: $('#popupForm').data('api').close(), however I have no reason to submit the PopupForm, hence I'm looking into Popup as well. To complicate things further, the menu hyperlinks will open their own PopupForms or just Ajax POST to the server. I would like to know how best to achieve my aim, but am happy to be guided to a better solution if one exists. Thanks in advance.
Save Changes
Cancel
Adam
asked at 30 Aug 2016
Answers
B
I
{code}
?
you can put this inside your popup: <button type="button" onclick="closeme(event)" class="awe-btn">close this popup</button> <script> function closeme(e) { $(e.target).closest('.awe-popup').data('api').close(); return false; } </script>
Save Changes
Cancel
Omu
answered at 04 Sep 2016
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK