jQuery-UI对话框将不显示按钮 [英] jQuery-UI dialog will not show buttons
本文介绍了jQuery-UI对话框将不显示按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个奇怪的问题,也许解决方法会非常简单.
I have a strange issue, and maybe the solution will be very simple.
我的对话框正在显示,但是没有给定的按钮.请帮助我.
My dialog is showing, but without the given buttons. Please help me.
我有:
<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>
推荐答案
我自己找到了解决方案:
Found solution by myself:
<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>
这篇关于jQuery-UI对话框将不显示按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文