title: ExtJS 6.2 : creating a custom filter for a gridcolumn
body: <p>I'd like to create a custom filter for my gridcolumn. </p>
  
  <p>I tried this: </p>
  
  <pre><code>Ext.define('Myapp.grid.filters.filter.Float', {
    extend : 'Ext.grid.filters.filter.Number',
    alias  : ['grid.filter.float'],
  
    type : 'float',
  
    config : {
      serializer : function (f) {
        return {
          type     : 'float',
          value    : f.value,
          property : f.property,
          operator : f.operator
        };
      }
    }
  });
  </code></pre>
  
  <p>Then I tried to use the filter in my gridcolumn:</p>
  
  <pre><code>   {
        header     : 'Foo',
        dataIndex  : 'bar',
        filterable : true,
        filter     : {
          type : 'float'
        }
      }
  </code></pre>
  
  <p>How do I create, add or register filters to the <a href="https://docs.sencha.com/extjs/6.2.0/classic/Ext.grid.filters.Filters.html" rel="nofollow noreferrer">gridfilter</a>-plugin in my application? I really don't get it. </p>
  
  <p>Thanks in advance</p>
  
  <p>Solution: </p>
  
  <p>We used the createFilter-function in <a href="https://docs.sencha.com/extjs/6.2.0/classic/Ext.grid.filters.filter.Base.html" rel="nofollow noreferrer">Ext.grid.filters.filter.Base</a> to create and use the filter:</p>
  
  <pre><code>Ext.define('MyApp.foo.bar.FloatFilter', {
    extend : 'Ext.grid.filters.filter.Number',
    alias  : 'grid.filter.float',
  
    createFilter : function (config, key) {
      config.type = 'float';
      return this.callParent(arguments);
    }
  
  });
  </code></pre>