I am using jquery ui dialog. I have initialized a dialog at document.ready event.
$("#globalConfirm").dialog({
width: 500, autoOpen: false, resizable: false, draggable: false,
modal: false
});
This dialog is for confirmation. Now later i want to add a buttons options and there callback functions like :
$("#globalConfirm").dialog("option", "buttons", '{
"Confirm": function (event, ui) {
//jquery code
},
"Cancle": function (event, ui) {
$(this).dialog("close");
}'
);
Is this write way to initialize the buttons option of jquery ui dialog after initializing dialog ?