X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/examples/grid-filtering/grid/filter/StringFilter.js diff --git a/examples/grid-filtering/grid/filter/StringFilter.js b/examples/grid-filtering/grid/filter/StringFilter.js deleted file mode 100644 index d384bd83..00000000 --- a/examples/grid-filtering/grid/filter/StringFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Ext JS Library 2.2.1 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - -Ext.grid.filter.StringFilter = Ext.extend(Ext.grid.filter.Filter, { - updateBuffer: 500, - icon: '/img/small_icons/famfamfam/find.png', - - init: function() { - var value = this.value = new Ext.menu.EditableItem({icon: this.icon}); - value.on('keyup', this.onKeyUp, this); - this.menu.add(value); - - this.updateTask = new Ext.util.DelayedTask(this.fireUpdate, this); - }, - - onKeyUp: function(event) { - if(event.getKey() == event.ENTER){ - this.menu.hide(true); - return; - } - this.updateTask.delay(this.updateBuffer); - }, - - isActivatable: function() { - return this.value.getValue().length > 0; - }, - - fireUpdate: function() { - if(this.active) { - this.fireEvent("update", this); - } - this.setActive(this.isActivatable()); - }, - - setValue: function(value) { - this.value.setValue(value); - this.fireEvent("update", this); - }, - - getValue: function() { - return this.value.getValue(); - }, - - serialize: function() { - var args = {type: 'string', value: this.getValue()}; - this.fireEvent('serialize', args, this); - return args; - }, - - validateRecord: function(record) { - var val = record.get(this.dataIndex); - if(typeof val != "string") { - return this.getValue().length == 0; - } - return val.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1; - } -}); \ No newline at end of file