title: how to read extjs data store
body: <p>I want to read a particular value of an extjs data store and manipulate it locally. 
  Response xml looks like :</p>
  
  <pre><code>&lt;user&gt;&lt;name&gt;abc&lt;/name&gt;&lt;surname&gt;def&lt;/surname&gt;&lt;book&gt;&lt;bname&gt;book1&lt;/bname&gt;&lt;/book&gt;&lt;/user&gt;
  </code></pre>
  
  <p>My store will have just one user entry when response is received and i want to read 'bname' value. So far i have tried two approaches and both giving error. </p>
  
  <p>approach1:</p>
  
  <pre><code>Ext.define('user', {
       extend: 'Ext.data.Model',
       fields: [ 'name', 'surname'],
       hasMany: {model: 'Book', name: 'book'},
        proxy: {
          type: 'rest',
           url : request,
           reader: { type: 'json', root: 'user'}
       }
   });
   Ext.define('Book', {
       extend: 'Ext.data.Model',
       fields: [ 'name'],
       belongsTo: 'user'
   });
   var userstore = Ext.create('Ext.data.Store', {
          model: "user"
   });
   incidentstore.load({
       callback: function() {
          var inc = userstore.first();
          var bk = inc.getBook();
          console.log(dev.get('bname'));
      }
  });
  </code></pre>
  
  <p>Running above code gives error that 'Ext.define is not a function'.</p>
  
  <p>Approach2:</p>
  
  <pre><code>var proxy1 = new Jx.JxHttpProxyRest({
      url: request,
      api : {
              read : { headers : {     'Accept' : APP + '.abc.def.usermanage.user+json;version=1' } }
          }
      });
  
  var reader = new Ext.data.XmlReader( {
      rootProperty : 'user',
      record : 'book',
      id : 'id',
  }, [{ name : 'bname', mapping : 'book &gt; bname'} ]);
  
  var writer = new Ext.data.XmlWriter( {
      encode : false
  });
  
  var newstore = new Ext.data.Store( {
      id : 'book',
      restful : true,
      proxy : proxy1,
      remoteSort : true,
      reader : reader,
      writer : writer,
      autoload: true,
      listeners: {
          load: function() {
              console.log(newstore.data.first());
          }
      }
  });
  Ext.data.DataProxy.addListener('load', function(proxy, type, action, options, res) {
      console.log(res.responseText);
  });
  newstore.load( {
      params : { start : 0, limit : myPageSize },
  
  });
  </code></pre>
  
  <p>Above code does not display anything on console.</p>
  
  <p>I am new to extjs and not sure how i can access 'bname' value from response. It would be great if someone can help</p>