2016-09-29 33 views
5

jQuery的用户界面对话框显示关闭图标和 “关闭” 的错误文字..jQuery的用户界面对话框显示关闭图标和文字错误

jQuery UI的版本1.12.1及代码:

function callDialog() { 
    $("#dialog-confirm").dialog({ 
     closeOnEscape: false, resizable: false, height: "auto", width: 400, modal: true, buttons: { 
      "Yes": function() { 
       $(this).dialog("close"); }, 
      "No": function() { 
       $(this).dialog("close"); } 
     } 
    }); 
} 

如何修复 enter image description here

+0

这可能与CSS。请提供有关您当前的代码和jQuery UI版本和主题的更多详细信息。 – Twisty

+0

jQuery UI的版本1.12.1及代码:function callDialog(){ $( “#对话,确认”)对话框({ closeOnEscape:假的, 可调整大小:假的, 高度: “自动”, 宽度:400 , 模式:真, 按钮:{ “是”:函数(){$ (本).dialog( “亲密”);} , “否”:函数(){$ (本)。对话框(“关闭”); } } }); } –

+0

您是否找到解决问题的办法? – Baso

回答

1

我有同样的错误,并通过改变代码closeText的以下行纠正:“关闭”为closeText:在jQuery的UI文件“”

$.widget("ui.dialog", { 
version: "1.12.1", 
options: { 
    appendTo: "body", 
    autoOpen: true, 
    buttons: [], 
    classes: { 
     "ui-dialog": "ui-corner-all", 
     "ui-dialog-titlebar": "ui-corner-all" 
    }, 
    closeOnEscape: true, 
    closeText: "", 
1

我已经解决了这个添加closeText(见最后一行):

\t \t $('#dialog').dialog({ 
 
\t \t \t autoOpen: false, 
 
\t \t \t width: 500, 
 
\t \t \t height:500, 
 
\t \t \t resizable: true, 
 
\t \t \t title: 'Items', 
 
\t \t \t modal: true, 
 
\t \t \t open: function(event, ui) { 
 
\t \t \t \t $(this).load("@Url.Action("StorageItemListPartial", "StorageItem")"); 
 
\t \t \t }, 
 
\t \t \t buttons: { 
 
\t \t \t \t "Close": function() { 
 
\t \t \t \t \t $(this).dialog("close"); 
 
\t \t \t \t } 
 
\t \t \t }, 
 
\t \t \t closeText: '' 
 
\t \t });

相关问题