Attempting to change multiple jQuery UI dialog() buttons on the fly.
The problem with below code is that only one button is displayed at the first instance of the di
I have tried to use the Object type for the buttons and it works :
dlg.dialog(
'option',
'buttons', {
"Download": function () {...},
"Not now": function () {...}
}
);
See updated jsFiddle
Object: The keys are the button labels and the values are the callbacks for when the associated button is clicked.
EDIT : But you had an error in your array, you must have an array of object and there were missing { and }.
'buttons', [
{
text: "Download",
click: function () {...}
},
{
text: "Not now",
click: function () {...}
}
]
See correction of your jsFiddle