Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
ons-alert-dialog doesn't work
-
hello! i tried using dialog and found out that ons-alert-dialog doesn’t work at all. Only ons-dialog is working fine. <ons-alert-dialog> shows the empty dialog like in photo below.
<ons-page id="dialog.html"> <ons-alert-dialog id="dialog-1"> <div style="text-align: center; padding: 10px;"> <p> This is a dialog. <p> <p> <ons-button onclick="hideDialog('dialog-1')">Close</ons-button> </p> </div> </ons-alert-dialog> </ons-page>
-
@iriekun Move your alert-dialog outside of your ons-page - that will solve your issue. Here are some excellent examples: http://tutorial.onsen.io/?framework=vanilla&category=Reference&module=dialog
-
Although I put it outside <ons-page> it still doesn’t show anything! just an empty dialog like above photo
-
@iriekun What platform? Any additional frameworks or plugins? Can you post more of your code or make a codepen?
Edit: Can you run this codepen and let me know what happens? https://codepen.io/anon/pen/eBdPRV
-
for both iOS and android and no additional framework. The code work with codepen but not with my project. Btw I use cloud monaca
https://codepen.io/anon/pen/eBdPMr
-
Your code worked for me.
Now, I presume you meant the codepen worked for you as well but not when ran on the debugger. If so, that would indicate to me we have other problems in your code. Have you tried a stripped down project to check functionality yet?
Here it is running in debugger.