Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery-ui dialog display close icon and wrong text

Tags:

jquery-ui

jquery-ui dialog display close icon and "close" 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

like image 669
nguyen phuoc Hai Avatar asked Sep 29 '16 10:09

nguyen phuoc Hai


Video Answer


2 Answers

I've solved this adding closeText (see the 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: ''
		});
like image 53
Michal Pokluda Avatar answered Jan 01 '23 08:01

Michal Pokluda


I had this same error and correct it by changing the following line of code closeText: "Close" for closeText: "" in 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: "",
like image 35
Hector Gonzalez Cortes Avatar answered Jan 01 '23 09:01

Hector Gonzalez Cortes