Last active
August 29, 2015 14:07
-
-
Save Thinkscape/1dc19312b5ad1447b532 to your computer and use it in GitHub Desktop.
Add support for configurable filter "property"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add support for configurable filter "property" | |
| */ | |
| Ext.define('Ext.bugfix.GridFilterBase', { | |
| override: 'Ext.grid.filters.filter.Base', | |
| config: { | |
| /** | |
| * @cfg {String} property | |
| * The property name to use when creating a filter | |
| */ | |
| property: null | |
| }, | |
| createFilter: function (config, key) { | |
| config.id = this.getBaseIdPrefix(); | |
| if (!config.property) { | |
| if (this.property) { | |
| config.property = this.property; | |
| } else { | |
| config.property = this.column.dataIndex; | |
| } | |
| } | |
| if (!config.root) { | |
| config.root = this.defaultRoot; | |
| } | |
| if (key) { | |
| config.id += '-' + key; | |
| } | |
| return new Ext.util.Filter(config); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment