How to add Dialog buttons from ajax data

How to add Dialog buttons from ajax data

I'm using the Dialog UI to assist users in manipulating data.  My current code uses the .load function to get the dialog content into the DIV and then create the dialog.  This all works fine to load the dynamic content of the Dialog.
 
My problem is I need the Dialog to be more dynamic than just content.  The page the Dialog is called from doesn't know what title, class or buttons to place on the dialog.
 
My best attempt so far is to us .ajax to return a JSON data object and modify the Dialog using the options like this;
 
This works as expected;
$( "#dialog" ).dialog( "option", "title", my_JSON_data.title );
$( "#dialog" ).dialog( "option", "dialogClass", my_JSON_data.dialogClass );
 
This does not work;
$( "#dialog" ).dialog( "option", "buttons", my_JSON_data.buttons );
 
I believe this is because the JSON data is only treated as text.
 
Here's what the JSON data looks like;
{
      "title":"Warning!",
      "dialogClass":"warning",
      "wide": 450,
      "buttons":"{'Cancel':function(){$('#dialog').dialog('close');},'Allow':function(){$('#dialog').dialog('close');}} "
}
 
So the challenge is - Does anybody know or have other ideas on how add dialog buttons from the .ajax?
 
Thanks,
-Mike