我有一个奇怪的问题,也许解决方案很简单。
我的对话框正在显示,但没有给定的按钮。请帮帮我。
我有:
<div id="dialog">Are you sure you want to delete this user?</div>
<script type="text/javascript">
function openDialog(usrId){
$("#dialog").dialog({
buttons: {
'Delete': function(){
window.location = '/user/index/remove-user/usrId/'+usrId
},
'Cancel': function(){
$(this).dialog('close')
}
}
}).dialog("open");
return false;
}
</script>
答案 0 :(得分:0)
您是否包含所有Jquery Dialog js / css文件?
答案 1 :(得分:0)
自己找到解决方案:
<div id="dialog">Are you sure you want to delete this user?</div>
<script type="text/javascript">
function openDialog(usrId){
$("#dialog").dialog("option", "buttons",
{
'Delete':function(){ window.location = '/user/index/remove-user/usrId/'+usrId; $(this).dialog("close"); }
,
'Cancel':function(){ $(this).dialog('close') }
}
).dialog("open");
return false;
}
</script>