title: How to make a store with jsonreader using metadata in Extjs 4?
body: <p>Is it possible to create a store that will read json, and use fields specified in the metadata in the json as a model?</p>
  
  <p>I want to say something like:</p>
  
  <pre><code>var store = new Ext.data.Store({
      autoLoad: {
          params: {
              metaNeeded: true
          }
      },
      reader: new Ext.data.JsonReader({fields:[]}),
      proxy: new Ext.data.HttpProxy({
          api: {
              url: 'php/chart-data.php'
          }
      })
  });
  </code></pre>
  
  <p>I've tried a number of combinations however I cannot seem to get it to work.
  I currently get the error "Cannot call method 'indexOf' of undefined". I've had others including "object has no read method".</p>
  
  <p>The json I am sending is:</p>
  
  <pre><code>{
    metadata:{
      root:"rows",
      sortInfo:{
         field:"date",
         direction:"ASC"
      },
      fields:[ {
            name:"date"
         }, {
            name:"flow"
         },{
            name:"limit"
         }
      ],
      idProperty:"date"
    },
    success:true,
    rows: &lt;&lt; snip &gt;&gt;
  }
  </code></pre>
  
  <p>Is it possible to have the store's model configured by the data that it receives, so I could use the same store later with different fields (e.g. date, flow, limit and temperature)?</p>