javascript - Jquery dialog add buttons on open -


i have got jquery dialog autoopen set false:

$(document).ready(function() { $('#test').text("hello!").dialog({           autoopen: false,           resizable: false,           modal: true,    }); }); 

i trigger dialog this:

$('x').click(function() {$('#test').dialog('open');}); 

i want add buttons functionality on open, this:

$('x').click(function() {$('#test').dialog('open', 'option', 'buttons', {     'ok': function() {         myfunction();         $(this).dialog('close');     } }); }); 

but no luck far, help?

change third part :

open: function (type, data) {     $(this).parent().appendto("form"); },  buttons: { "ok": function() { $(this).dialog("close"); } }  

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -