Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / ux / gridfilters / filter / StringFilter.js
diff --git a/examples/ux/gridfilters/filter/StringFilter.js b/examples/ux/gridfilters/filter/StringFilter.js
deleted file mode 100644 (file)
index 40ccbb5..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-/** \r
- * @class Ext.ux.grid.filter.StringFilter\r
- * @extends Ext.ux.grid.filter.Filter\r
- * Filter by a configurable Ext.form.TextField\r
- * <p><b><u>Example Usage:</u></b></p>\r
- * <pre><code>    \r
-var filters = new Ext.ux.grid.GridFilters({\r
-    ...\r
-    filters: [{\r
-        // required configs\r
-        type: 'string',\r
-        dataIndex: 'name',\r
-        \r
-        // optional configs\r
-        value: 'foo',\r
-        active: true, // default is false\r
-        iconCls: 'ux-gridfilter-text-icon' // default\r
-        // any Ext.form.TextField configs accepted\r
-    }]\r
-});\r
- * </code></pre>\r
- */\r
-Ext.ux.grid.filter.StringFilter = Ext.extend(Ext.ux.grid.filter.Filter, {\r
-\r
-    /**\r
-     * @cfg {String} iconCls\r
-     * The iconCls to be applied to the menu item.\r
-     * Defaults to <tt>'ux-gridfilter-text-icon'</tt>.\r
-     */\r
-    iconCls : 'ux-gridfilter-text-icon',\r
-\r
-    emptyText: 'Enter Filter Text...',\r
-    selectOnFocus: true,\r
-    width: 125,\r
-    \r
-    /**  \r
-     * @private\r
-     * Template method that is to initialize the filter and install required menu items.\r
-     */\r
-    init : function (config) {\r
-        Ext.applyIf(config, {\r
-            enableKeyEvents: true,\r
-            iconCls: this.iconCls,\r
-            listeners: {\r
-                scope: this,\r
-                keyup: this.onInputKeyUp\r
-            }\r
-        });\r
-\r
-        this.inputItem = new Ext.form.TextField(config); \r
-        this.menu.add(this.inputItem);\r
-        this.updateTask = new Ext.util.DelayedTask(this.fireUpdate, this);\r
-    },\r
-    \r
-    /**\r
-     * @private\r
-     * Template method that is to get and return the value of the filter.\r
-     * @return {String} The value of this filter\r
-     */\r
-    getValue : function () {\r
-        return this.inputItem.getValue();\r
-    },\r
-    \r
-    /**\r
-     * @private\r
-     * Template method that is to set the value of the filter.\r
-     * @param {Object} value The value to set the filter\r
-     */        \r
-    setValue : function (value) {\r
-        this.inputItem.setValue(value);\r
-        this.fireEvent('update', this);\r
-    },\r
-\r
-    /**\r
-     * @private\r
-     * Template method that is to return <tt>true</tt> if the filter\r
-     * has enough configuration information to be activated.\r
-     * @return {Boolean}\r
-     */\r
-    isActivatable : function () {\r
-        return this.inputItem.getValue().length > 0;\r
-    },\r
-\r
-    /**\r
-     * @private\r
-     * Template method that is to get and return serialized filter data for\r
-     * transmission to the server.\r
-     * @return {Object/Array} An object or collection of objects containing\r
-     * key value pairs representing the current configuration of the filter.\r
-     */\r
-    getSerialArgs : function () {\r
-        return {type: 'string', value: this.getValue()};\r
-    },\r
-\r
-    /**\r
-     * Template method that is to validate the provided Ext.data.Record\r
-     * against the filters configuration.\r
-     * @param {Ext.data.Record} record The record to validate\r
-     * @return {Boolean} true if the record is valid within the bounds\r
-     * of the filter, false otherwise.\r
-     */\r
-    validateRecord : function (record) {\r
-        var val = record.get(this.dataIndex);\r
-\r
-        if(typeof val != 'string') {\r
-            return (this.getValue().length === 0);\r
-        }\r
-\r
-        return val.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1;\r
-    },\r
-    \r
-    /**  \r
-     * @private\r
-     * Handler method called when there is a keyup event on this.inputItem\r
-     */\r
-    onInputKeyUp : function (field, e) {\r
-        var k = e.getKey();\r
-        if (k == e.RETURN && field.isValid()) {\r
-            e.stopEvent();\r
-            this.menu.hide(true);\r
-            return;\r
-        }\r
-        // restart the timer\r
-        this.updateTask.delay(this.updateBuffer);\r
-    }\r
-});\r