Invoking the extension methods below will allow you to achieve the desired result.
Code Snippet
Code Snippet
- // Example:
- // $('#IDDialogDiv').dialog('addbutton', 'Name of button');
- // $('#IDDialogDiv').dialog('removebutton', 'Name of button');
- //
- //
- // Allows simple button addition to a ui dialog
- 'addbutton': function (buttonName, func) {
- var buttons = this.element.dialog('option', 'buttons');
- buttons[buttonName] = func;
- this.element.dialog('option', 'buttons', buttons);
- }
- });
- // Allows simple button removal from a ui dialog
- 'removebutton': function (buttonName) {
- var buttons = this.element.dialog('option', 'buttons');
- delete buttons[buttonName];
- this.element.dialog('option', 'buttons', buttons);
- }
- });
End of Code Snippet
No comments:
Post a Comment