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

Eclipse formatter for java ending braces -

ruby - Nesting modules inside of a Rails eninge gem -

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