Tim
Tim

Reputation: 3

Why does the jquery-ui-dialog close-function doesnt work with this button call?

I have this following code where buttons with the value "Add" are added. Now i wanted that these buttons close the dialog window. So i made an onClick attribute and linked it with the hey-function. But it doesnt close the window although it calls the close-function (look at the picture).

function dialog(type) {
    $(".dialog").dialog({
      resizable: true,
      height: 800,
      width: 800,
      modal: true,
      open: function () { 
        $(this).load('../SearchPage/search_page.jsp', function () {
            setDialogType(type); 
            $("h3").not(".header").append('<button onClick="hey()" style="background-color:green; color:white">Add</button>');  
      });   
      }, 
    }); 
} 

function hey() {
    $(".ui-dialog-content").dialog("close");
}

Firefox Debugger

Upvotes: 0

Views: 101

Answers (0)

Related Questions