【问题标题】:Multiple buttons in jquery ui dialog only one showsjquery ui对话框中的多个按钮只显示一个
【发布时间】:2013-08-15 18:54:58
【问题描述】:

Here 是小提琴。我看过问题'How to add multiple buttons in Jquery UI dialog box?',但那里提到的方法不起作用。接受的是:

$("#mydialog").dialog({
    buttons: {
        'Confirm': function() {
            //do something
            $(this).dialog('close');
        },
        'Cancel': function() {
            $(this).dialog('close');
        }
    }
});

随时修改我的小提琴并通知我!

【问题讨论】:

    标签: jquery jquery-ui button jquery-ui-dialog


    【解决方案1】:

    您链接的问题中的方法确实有效。你的小提琴不正确。它有

    $('#dialog').dialog({
        modal: true,
        dialogClass: 'no-close',
        buttons: [{
            text:'OK',
            click: function () {
                 $(this).dialog('close');
            },
            text:'Cancel',
            click: function () {
                 location.reload();
            }
        }]
    });
    

    如果您将其更改为您链接的问题中显示的格式

    $('#dialog').dialog({
         modal: true,
         dialogClass: 'no-close',
         buttons: {
             'OK' : function () {
                 $(this).dialog('close');
             },
             'Cancel' : function () {
                 location.reload();
             }
         }
     });
    

    你有两个按钮。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-22
      • 1970-01-01
      • 2011-01-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多