title: Cakephp $this->layout = 'ajax'
body: <p>my css dosnt seem to work when i declare $this->layout = 'ajax' in my controller.</p>
  
  <p>in my view1.ctp, i created a dialog box using jquery. the content will be getting from view2.ctp via jquery.ajax(). i created the html classes, id and all similar to view1.ctp.</p>
  
  <p>the content im receiving is ok. the problem is that the id and classes i declared within view2.ctp is not working. in short, im getting an empty dialog design. </p>
  
  <p>any idea on how to solve this? thank you in advance. cheers!</p>
  
  <p>in my view1.ctp:</p>
  
  <pre><code>&lt;div id="thisDialog"&gt;
      &lt;div id="content"&gt;
      &lt;/div&gt;
  &lt;/div&gt;  
  
  &lt;script&gt;
      jQuery('.test_box').live('click',function(){
          jQuery('#content').empty();
          jQuery.ajax({
              async:false,
              url: '/controller1/view2/'+id //url pointing to my 1controller.php
              success:function(data){
                  jQuery('#content').append(data);
  
              }
          });
  
  
          jQuery('#thisDialog').dialog('open');
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>here is controller1.php</p>
  
  <pre><code>function view2($id)
      {
      $this-&gt;layout = 'ajax';
      $query = $this-&gt;Model-&gt;find('all') //somequery here
  }
  </code></pre>
  
  <p>here is view2.ctp</p>
  
  <pre><code>&lt;div class='box'&gt;
       &lt;div class='title'&gt;
            &lt;h5&gt;Title here&lt;/h5&gt;
       &lt;/div&gt;
       &lt;div class='contents'&gt;
           &lt;table&gt;
               &lt;tr&gt;
               &lt;td class='head'&gt;&lt;/td&gt;
                &lt;td class='head'&gt;&lt;/td&gt;
                &lt;/tr&gt; 
                &lt;tr&gt;
                 &lt;td class='alt'&gt;Field content1 here&lt;/td&gt;
                 &lt;td&gt;Fields content2 here&lt;/td&gt;
                &lt;/tr&gt;
           &lt;/table&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>