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
Post a Comment