I want to be able to change the title of my modal and the buttons on run time. currently I have this I have actions either approval or Deny
var recButton = actions =='approval' ? 'Approve' : 'Deny';
$("#dialog").dialog(
    {
        modal : true,
        buttons : {
            'update all' : function() {
                // window.location.reload();
                // $( this ).dialog( "close" );
                //do something here
            },
            Cancel : function() {
                $(this).dialog("close");
            }
        }
    }); //dialog
});
I also tried to do this for button
$("#dialog").dialog(
    {
        modal : true,
        buttons : {
            recButton : function() { ...
but in modal it didn't translate well and just said recButton instead of the variable value. Also I need to change title too.
Update: got title working by simply title:

