title: YUI Datatable - "Data Error."
body: <p>I'm trying to make a datatable using YUI with JSON returned data.</p>
  
  <p>Included is the json returned data, and the page data displayed.</p>
  
  <p><em><strong>JSON Data:</em></strong></p>
  
  <pre><code>[{"supplier_id":"127","name":"Adams Farms","description":"","ofarm":"1","active":"1"},{"supplier_id":"141","name":"Barriger Farms","description":"","ofarm":"1","active":"1"}]
  </code></pre>
  
  <p><em><strong>Javascript for YUI:</em></strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  YAHOO.util.Event.addListener(window, "load", function() {
      YAHOO.example.JSON = function() {
          var myColumnDefs = [
              {key:"supplier_id", label:"ID"},
              {key:"name", label:"Name"},
              {key:"description", label:"Notes"},
              {key:"ofarm", label:"Ofarm"},
              {key:"active", label:"Active"}
          ];
  
          var myDataSource = new YAHOO.util.DataSource("ajax/select/supplier");
          myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
          myDataSource.responseSchema = {
              fields: ["supplier_id","name","description","ofarm","active"]
          };
  
          var myDataTable = new YAHOO.widget.DataTable("json", myColumnDefs,
                  myDataSource);
  
          return {
              oDS: myDataSource,
              oDT: myDataTable
          };
      }();
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><em><strong>Page View:</em></strong></p>
  
  <blockquote>
    <p>YUI Test <em>(header)</em></p>
    
    <p>This example populates a DataTable with data. <em>(intro text)</em></p>
    
    <p>ID - Name - Notes - Ofarm - Active   <em>(column titles)</em></p>
    
    <p>Data error. <em>(returned data)</em></p>
  </blockquote>