title: ExtJS5 Store filter "Uncaught TypeError: Cannot read property 'get' of undefined"
body: <p>I'm using the gpl version of extjs5.1.1 without sencha cmd.<br>
  In my application a Grid displays correctly a Store.<br>
  In the window, there is a checkbox wich code is :</p>
  
  <pre><code>{
      xtype    : 'checkbox',
      itemId   : 'employeeFilter',
      value    : false,
      boxLabel : 'Show inaktiv users',
      margin   : '0 5 0 5',
      listeners: {
          change: function(checkbox, newValue, oldValue, eOpts) {
              var store = this.up('window').getComponent('employeeGrid').getStore();
              if (newValue) {
                  console.log('clearFilter');
                  store.clearFilter();
              } else {
                  console.log('rightFilter');
                  store.rightFilter();
              }
          }
      }
  }]
  </code></pre>
  
  <p>The variable <code>store</code> points to the grid store correctly. I can see the messages 'clearFilter' and 'rightFilter' in the console.</p>
  
  <p>The store code:</p>
  
  <pre><code>Ext.define('Chronos.store.manage.Employees', {
      extend : 'Ext.data.Store',
  
      model      : 'Chronos.model.manage.Employee',
      autoLoad   : false,
      autoSync   : true,
      sortOnLoad : false,
      pageSize   : 0,
  
      rightFilter: function() {
          this.filterBy(function(record) {
              return record.get('rights') &gt;= 0;
          });
      },
  
      proxy : {
          type   : 'ajax', // Ext.data.proxy.Ajax
          api    : {
              create  : 'api/management/employees.create.php',
              read    : 'api/management/employees.read.php',
              update  : 'api/management/employees.update.php',
              destroy : 'api/management/employees.destroy.php'
          },
          reader : {
              type         : 'json', // Ext.data.reader.Json
              rootProperty : 'records'
          },
          writer : {
              type         : 'json', // Ext.data.writer.Json
              encode       : true,
              rootProperty : 'record'
          }
      }
  });
  </code></pre>
  
  <p>On window call, the checkbox  is unchecked and the filter is active because the grid listeners is:</p>
  
  <pre><code>    listeners: {
          render: function() {
              this.getStore().load();
              this.getStore().rightFilter(); // &lt;&lt;&lt;&lt;&lt; if the function is called here, the problem exists, if not, the filter works perfectly !
          }
      },
  </code></pre>
  
  <p>The first time I check the checkbox the filter is cleared correctly and the message 'clearFilter' appears in the console. When I uncheck it, the message 'rightFilter' appears too, but the filter does not anything in the grid... and the error message "Uncaught TypeError: Cannot read property 'get' of undefined" appears.  </p>
  
  <p>Where am I wrong?</p>
  
  <p><strong>Edit</strong>: Actually the filter function only works fine once. It does not work any more after <code>clearFilter</code> is called...<br>
  I tried with <code>addFilter</code>/<code>removeFilter</code> with the same result.<br>
  My next try will be <code>setDisable</code>.<br>
  If someone has any (other) idea...</p>
  
  <p><strong>Edit 2:</strong> Test case <a href="https://fiddle.sencha.com/#fiddle/ou6" rel="nofollow">in fiddle</a><br>
  Now I know that the problem comes from function call in the render function. When this call is not done, the checkbox works perfectly, but on show, the checkbox state does not correspond to the display and I want to hide filtered items on show.</p>
  
  <p>Any Idea ?</p>