1
我想在选择自动完成项目后让Jquery UI模式对话框接管。除了模式对话框启动后,我的所有内容都会弹出,但有代码正在运行。最后,我想让这个对话框弹出并根据按钮作出反应。Jquery - 选择自动完成期间使用模式对话框
从选择自动完成:
select: function(event, ui) {
if(ui.item.squad != '0'){
console.info('popup');
var choice=null;
$("#dialog-confirm").dialog({
resizable: false,
height:140,
modal: true,
buttons: {
Cancel: function() {
choice = false;
$(this).dialog("close");
},
"Move Shooter": function() {
choice = true;
$(this).dialog("close");
}
}
});
if(!choice){
console.info($(this));
$(this).text("");
$(this).val("");
$(this).attr("name", "");
$(this).attr("value", "");
console.info("false");
return;
}
}
大部分代码已经从jQuery UI的拍摄here.
当我运行此代码,我认为它会停止运行代码,直到一个按钮是按下但您可以看到here将打印出错误的控制台打印出来。
而你是我的英雄。谢谢您的帮助 – 2012-01-03 22:46:41