How can I change the buttons OR function of available buttons on a jQuery dialog window after it has been loaded?
<p>So I am opening a </p>

<pre><code>$('#someelement').dialog({ title.......
                           autoOpen: false,
                           //......

                           buttons: { OK: function() {
                                   $(this).dialog('close');}
                           },
                           //....
                         });
</code></pre>

<p>During this time a timer is running, if the user clicks "OK" I don't want anything to occur, but if the timer has run down, I would like change the function.  I have tried the following unsuccessfully:</p>

<pre><code>jQuery('#SessionTimeoutWarningDialog').dialog('option', 'buttons', {
                    'OK': function() {
                        RedirectToLogin;
                        jQuery(this).dialog('close');
                    }
                });
</code></pre>

<p>What am I doing wrong, or how should I be handling this?</p>
