I inject html for dialog via script like:
$("#misc-cntr").append('<div id="chk" data-rel="dialog" > </div>');
then in ajax success callback I have:
success: function(msg) {
$('#chk').html(msg)
// open dialog here
// $('#chk').dialog('open') does not work
}
Given above how can I open the dialog programatically?
You'll need to change the page to it, something along the lines of:
$.mobile.changePage($('#chk'), 'pop', false, true);
If you want to close the dialog via javascript, you'll need:
$('#chk').dialog('close');
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With