Jquery-ui dialog box close icon and incorrect text

The jquery-ui dialog box closes the icon and "closes" the wrong text.

jquery Ui version 1.12.1 and code:

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"); } } }); } 

How to fix it enter image description here

+5
source share
2 answers

I decided this to add closeText (see last line):

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

I had the same error and correct it by changing the following line of code closeText: "Close" to closeText: "" in the jquery-ui file

 $.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
source

Source: https://habr.com/ru/post/1257440/


All Articles