title: Object has no method setStore() - Sencha Touch 2
body: <p>Having a slight problem whilst trying to implement local storage into a Sencha Touch 2 app. I have it finding the data from my external store, but after that the function in my controller is supposed to switch the views store to the local storage store I have created once it finds and stores data initially.</p>
  
  <p>I have a reference to the view I want to update the store of, but when I try to update it using setStore it gives me the following error:</p>
  
  <p>Uncaught TypeError: Object [object Object] has no method 'setStore' </p>
  
  <p>Any help would be greatly appreciated. Here is the code:</p>
  
  <p>Controller:
      extend: 'Ext.app.Controller',</p>
  
  <pre><code>config: {
      refs: {
          buyTicketsView: 'buyticketspanel'
      },
      control: {
          'buyticketspanel list': {
              itemsingletap: 'buytickets'
          },
          buyTicketsView : {
              show: 'loadTickets'
          }
      }
  },
  
  buytickets: function(list, idx, el, record) {
      Ext.Msg.confirm('External Link', 'Open external link?', function(result){
          if (result == 'yes') {
              //window.location = 'http://www.youtube.com/watch?v=' + record.get('id');
              window.location = 'http://' + record.get('link');
          }
      });
  },
  
  loadTickets: function() {
      //set up refs to the two stores
      var ticketStore = Ext.getStore('ticketStore');
      var ticketStoreLocalStorage= Ext.getStore('buyTicketsLocalStorage');
  
      //load the localStorage store
      ticketStoreLocalStorage.load();
  
      // check if localStorage contains data
      if ((ticketStoreLocalStorage.getCount()) == 0) {
          // nothing found so  we need to load the data from external source
          console.log('localStorage data not found');
          //hand off to onMarkerStoreLoad function (below)
          ticketStore.on({
              load: 'onTicketStoreLoad',
              scope: this
          });
          //call load to trigger above
          ticketStore.load();
      } else {
          // we are ok, just print some debug
          console.log('localStorage data found');
          console.log('localStorage count:' + ticketStoreLocalStorage.getCount());
      }
      //finally set the list's store to localStorage
      console.log(this.getBuyTicketsView());
      //THIS LINE IS THE ONE THAT IS FAILING
      this.getBuyTicketsView().setStore(ticketStoreLocalStorage);
  
  },
  onTicketStoreLoad: function() {
      //set up refs
      var ticketStoreLocalStorage= Ext.getStore('buyTicketsLocalStorage');
      var ticketStore = Ext.getStore('ticketStore');
          //loop through each data item and add to localStorage
      ticketStore.each(function(item){
          ticketStoreLocalStorage.add(item);
      });
      ticketStoreLocalStorage.sync();
   }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>extend: 'Ext.navigation.View',
  xtype: 'buyticketspanel',
  
  config: {
      navigationBar: {
         hidden: true
      },
      title: 'Buy Tickets',
      iconCls: 'MyScheduleIcon nav-schedule',
      items: [
          {
              docked: 'top',
              xtype: 'toolbar',
              title: '&lt;span class="logo"&gt;&lt;/span&gt;'
          },
          {
            xtype: 'list',
  
            itemTpl: '&lt;div class="date-circle"&gt;{date}&lt;/div&gt;&lt;div class="event-title"&gt;{title} - {location}&lt;/div&gt;&lt;div class="buy-tickets-btn"&gt;Buy Tickets&lt;/div&gt;'
         }
      ]
  
  }
  </code></pre>
  
  <p>Edit: It also isn't showing the data on the view after switching to the localstorage store for it's data, which makes me think that it isn't actually switching.</p>