X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/examples/form/SearchField.js diff --git a/examples/form/SearchField.js b/examples/form/SearchField.js deleted file mode 100644 index b89f07b0..00000000 --- a/examples/form/SearchField.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Ext JS Library 2.2.1 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - -Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, { - initComponent : function(){ - Ext.app.SearchField.superclass.initComponent.call(this); - this.on('specialkey', function(f, e){ - if(e.getKey() == e.ENTER){ - this.onTrigger2Click(); - } - }, this); - }, - - validationEvent:false, - validateOnBlur:false, - trigger1Class:'x-form-clear-trigger', - trigger2Class:'x-form-search-trigger', - hideTrigger1:true, - width:180, - hasSearch : false, - paramName : 'query', - - onTrigger1Click : function(){ - if(this.hasSearch){ - this.el.dom.value = ''; - var o = {start: 0}; - this.store.baseParams = this.store.baseParams || {}; - this.store.baseParams[this.paramName] = ''; - this.store.reload({params:o}); - this.triggers[0].hide(); - this.hasSearch = false; - } - }, - - onTrigger2Click : function(){ - var v = this.getRawValue(); - if(v.length < 1){ - this.onTrigger1Click(); - return; - } - var o = {start: 0}; - this.store.baseParams = this.store.baseParams || {}; - this.store.baseParams[this.paramName] = v; - this.store.reload({params:o}); - this.hasSearch = true; - this.triggers[0].show(); - } -}); \ No newline at end of file