how to change html of dialog dynamically in onsen

半腔热情 提交于 2019-12-21 21:37:27

问题


I'm trying to dynamically change the html content of a dialog of onse.ui, but it is not working for me, my code is as below:

Here my html code.

<ons-template id="popupFechaCalendario.html">
    <ons-dialog  style="height: 300px;" var="naviDialog" cancelable>
        <ons-navigator var="myNav">
            <ons-toolbar inline>
               <div class="center contenedorPopup" id="popupFechaCalendario_fecha">html content</div>
            </ons-toolbar>
        </ons-navigator>
     </ons-dialog>
</ons-template>

And here my Javascript code.

$("#popupFechaCalendario_fecha").html("some html...");

ons.createDialog('popupFechaCalendario.html').then(function(dialog) {
    dialog.show();
});

I have also tried like,

ons.createDialog('popupFechaCalendario.html').then(function(dialog) {
    dialog.on("preshow", function(e) {
        $("#popupFechaCalendario_fecha").html("some html...");
    });
    dialog.show();
});

In advance thank you very much to anyone who can help me

来源:https://stackoverflow.com/questions/32594923/how-to-change-html-of-dialog-dynamically-in-onsen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!