+
+ function add (dataIndex, config, filterable) {
+ if (dataIndex && (filterable || config)) {
+ field = fields.get(dataIndex);
+ filter = {
+ dataIndex: dataIndex,
+ type: (field && field.type && field.type.type) || 'auto'
+ };
+
+ if (Ext.isObject(config)) {
+ Ext.apply(filter, config);
+ }
+
+ filters.replace(filter);
+ }
+ }
+
+ // We start with filters from our config and then merge on filters from the columns
+ // in the grid. The Grid columns take precedence.
+ Ext.Array.each(me.filterConfigs, function (fc) {
+ add(fc.dataIndex, fc);
+ });
+
+ Ext.Array.each(grid.columns, function (column) {
+ if (column.filterable === false) {
+ filters.removeAtKey(column.dataIndex);
+ } else {
+ add(column.dataIndex, column.filter, column.filterable);
+ }
+ });
+