使用SimpleDialog作为另一个对话框的结果启动一个对话框

Initiating a dialog as a result of another dialog using SimpleDialog

本文关键字:对话框 一个 启动 SimpleDialog 另一个 使用 结果      更新时间:2023-09-26

我试图使用JQuery Mobile的SimpleDialog来启动一个新对话框,但它在我的Android手机(三星Galaxy SII,Android 2.3.6)上不起作用。在桌面浏览器中它起作用。

它应该在第一个对话框上按下OK后显示第二个对话框,但它不会。

我现在使用以下代码来测试它:

$("#Home").simpledialog({
    'mode': 'bool',
    'prompt': 'First Dialog To Show',
    'useModal': true,        
    'allowReopen': true,
    'onClosed': function () {
        alert("This Alert Gets Shown");
        $("#Home").simpledialog({
            'mode': 'bool',
            'prompt': 'Seconds Dialog To Show',
            'useModal': true,
            'allowReopen': true,           
            'onClosed': function () {
                //alert("bloces");
            },
            'buttons': {
                'OK': {
                    click: function () {
                        return true;
                    }
                }
            }
        });
    },
    'buttons': {
        'OK': {
            click: function () {
                return true;
            }
        }
    }
});
dialog Ok button event = function(){ WaitUntilDialogsAreClosed("your callback")}
function WaitUntilDialogsAreClosed(Callback)
{
var contition = function(){return $.mobile.sdCurrentDialog}
    if (contition() == false) {
        setTimeout(function(){WaitUntil(contition, Callback)}, 500)
    }
    else {
            Callback();
    }
}   
相关文章: