1

我有一个奇怪的问题,也许解决方案会很简单。

我的对话框正在显示,但没有给定的按钮。请帮我。

我有:

 <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>
4

2 回答 2

1

自己找到解决方案:

<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>
于 2012-08-10T09:36:03.530 回答
0

您是否包含所有 Jquery Dialog js/css 文件?

于 2012-08-10T09:21:20.557 回答