2

I need to open (call) a ui-dialog box from a function javascript. Currently I have these two codes:

setTimeout(function() {
var zone = event.getTarget().getName();                  
var x = window.confirm("Do you want to continue?");                     
if (x) {
    readData();
} else {
    e.preventDefault();
}
}, 0);

and,

$( "#dialogZone" ).dialog({
autoOpen: false,
show: "blind",
hide: "blind",
modal: true,
buttons: {
    "YES": function() {
        $(this).dialog("close");
        readData();
    },
    Cancel: function() {
        $(this).dialog("close");
        //avoid some info windows in #tab1
    }
}
});

$( "#openEvent" ).click(function() {
$( "#dialogZone" ).dialog( "open" );
return false;
});
});

Please, can I have some thing like...

setTimeout(function() {
   // show ui-dialogbox
}

Thanks in advance for your answers. Regards.

1 Answer 1

1

You already have it in your code:

  $( "#dialogZone" ).dialog( "open" ); 

to open dialog, so put this line in your timeouted function

Sign up to request clarification or add additional context in comments.

1 Comment

Vittore, It works fine but when I click on button "Yes" anything happen... do you know how is my problem please?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.