title: ExtJS - localStorage
body: <p>I have 'Movie' model and hold data in Ext.data.Store. Movies are displayed in gridPanel. After giving search param and clicking button store is reloading.</p>
  
  <p>Now, I'm trying to use localStorage. It rather should save data inside function of listener:</p>
  
  <pre><code>listeners: {
                  'click': function() {
                      movieDataStore.sync();
                      var textValue = Ext.getCmp("searchFieldId").getValue();
  
                      movieDataStore.load({
                          params : {
                              start : 0,
                              limit : 25,
                              t : textValue
                          }
                      });
                  }
              }
  </code></pre>
  
  <p>How should I make it?</p>
  
  <hr>
  
  <p>UPDATE V1</p>
  
  <p>If I would use Ext.state.LocalStorageProvider should I initialize cache variable like this:</p>
  
  <pre><code>        var movieLocalCacheStore = Ext.state.LocalStorageProvider.create(); 
  
      var movieGridPanel = Ext.create('Ext.grid.Panel', {
          store : movieDataStore,
  
          tbar : [ 'Search', {
              xtype : 'textfield',
              name : 'searchField',
              id: 'searchFieldId',
              emptyText : 'Put movie title here',
              hideLabel : true,
              width : 200
          }, {
              xtype : 'button',
              text : 'Search',
              tooltip : 'Search for movie',
              listeners: {
                  'click': function() {
                      var textValue = Ext.getCmp("searchFieldId").getValue();
  
                      movieDataStore.load({
                          params : {
                              start : 0,
                              limit : 25,
                              t : textValue
                          }
                      });
                      movieDataStore.sync();
                      movieGridPanel.getView().refresh();
  
                      //localStorage.setItem(textValue, movieDataStore.getAt(0));
                      movieLocalCacheStore.set(textValue, movieDataStore.getAt(0));
  
                  }
              }
          } ]
      });
  </code></pre>
  
  <p>?</p>
  
  <p>I have a model named 'MovieModel'. Is it <code>movieDataStore.getAt(0)</code> correct way to get object?</p>
  
  <p>How should I check if there is cached search results (and load to movieDataStore/movieGridPanel)?</p>