title: Jquery Dialog Dynamic Buttons Are Not Visible
body: <p>I want to add dynamic buttons in dialog box. I am using the following script without success. The button "Close" does not show up when I extend the dialog. What did I wrong ?</p>
  
  <pre><code>&lt;head&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen" href="jquery-ui.css" /&gt;
  
  &lt;script src="jquery-2.1.4.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script src="jquery-ui.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div&gt;
  
  &lt;div id="dialog"&gt;
      Dialog bodyyyy
  &lt;/div&gt;
  
  
  &lt;/div&gt;
  &lt;script&gt;
  var mydialog = $("#dialog").dialog({
              dialogClass: "noclose",
              resizable: false,
              modal: true,
              title: "Modal",
              height: "auto",
              width: "auto"
          });
  
  var btns = mydialog.dialog("option", "buttons");
  
  $.extend(btns, { "Close": function () { $("#dialog").dialog("close"); } });
  
  mydialog.dialog("option", "buttons", btns);
  
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>