I am creating a modal JQuery UI Dialog box and storing the result in the $dialog variable. The buttons change depending on which operation is chosen, so I set the buttons using a function call like this:
$dialog.dialog( "option", "buttons", [
{
text: "Ok",
click: function() { close_project(); }
},
{
text: "Cancel",
click: function() { ($this).dialog("close"); }
}
]);
This displays two buttons with the text '0' and '1' in them instead of 'Ok' and 'Cancel'. Also, the click functions do not appear to be working.
I've gone over this a number of times and the syntax looks correct. What am I doing wrong?
jQuery UI help for this says method you are using is for modal already initialized - http://jqueryui.com/demos/dialog/#option-buttons Is this the case?
If not, try this one and then experiment how it is different or suitable for your solution:
$dialog.dialog({ buttons: [
{
text: "Ok",
click: function() { close_project(); }
},
{
text: "Cancel",
click: function() { $(this).dialog("close"); }
}
]});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With