title: rendering a grid from a table: "this.mainBody is undefined"
body: <p>I have a static html table on a page and i would like to transform it to a grid; so i applied this function after loading the table:</p>
  
  <pre><code>function createTable() {
  
          // create the grid
          var grid = new Ext.ux.grid.TableGrid("tabella-colocazioni", {
              stripeRows: true // stripe alternate rows
          });
          grid.render();
  }
  </code></pre>
  
  <p>I got this piece of code from here: <a href="http://www.java2s.com/Code/JavaScript/Ext-JS/CreateagridwithfromanexistingunformattedHTMLtable.htm" rel="nofollow noreferrer">http://www.java2s.com/Code/JavaScript/Ext-JS/CreateagridwithfromanexistingunformattedHTMLtable.htm</a> . The result is the error "this.mainBody is undefined on ext-all-debug.js" on FireBug and the grid is empty. The html code of the table is this:</p>
  
  <pre><code>&lt;table cellspacing="0" id="tabella-colocazioni"&gt;
     &lt;thead&gt;
        &lt;tr style="background:#eeeeee;"&gt;
           &lt;th&gt;Colocazione&lt;/th&gt;
           &lt;th&gt;Frequenza&lt;/th&gt;
        &lt;/tr&gt;
     &lt;/thead&gt;
     &lt;tbody&gt;
        &lt;tr&gt;
           &lt;td&gt;plusquam patria&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;patria pietate&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;Et patria&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;patria prohibet&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;Multos patria&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;patria reddidit&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;patronum patria&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
           &lt;td&gt;patria moesta&lt;/td&gt;
           &lt;td&gt;1&lt;/td&gt;
        &lt;/tr&gt;
     &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>What is the problem? Thank you very much.</p>