Skip to content

Instantly share code, notes, and snippets.

@Thinkscape
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save Thinkscape/1dc19312b5ad1447b532 to your computer and use it in GitHub Desktop.

Select an option

Save Thinkscape/1dc19312b5ad1447b532 to your computer and use it in GitHub Desktop.
Add support for configurable filter "property"
/**
* 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