【问题标题】:jQuery-UI dialog will not show buttonsjQuery-UI 对话框不会显示按钮
【发布时间】:2012-08-10 17:36:03
【问题描述】:

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

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

我有:

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

【问题讨论】:

    标签: javascript jquery-ui jquery-ui-dialog


    【解决方案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>
    

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 在我的
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-19
      • 2019-10-22
      • 2013-06-14
      相关资源
      最近更新 更多