3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
9 Ext.ux.form.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
10 initComponent : function(){
11 Ext.ux.form.SearchField.superclass.initComponent.call(this);
12 this.on('specialkey', function(f, e){
13 if(e.getKey() == e.ENTER){
14 this.onTrigger2Click();
19 validationEvent:false,
21 trigger1Class:'x-form-clear-trigger',
22 trigger2Class:'x-form-search-trigger',
28 onTrigger1Click : function(){
30 this.el.dom.value = '';
32 this.store.baseParams = this.store.baseParams || {};
33 this.store.baseParams[this.paramName] = '';
34 this.store.reload({params:o});
35 this.triggers[0].hide();
36 this.hasSearch = false;
40 onTrigger2Click : function(){
41 var v = this.getRawValue();
43 this.onTrigger1Click();
47 this.store.baseParams = this.store.baseParams || {};
48 this.store.baseParams[this.paramName] = v;
49 this.store.reload({params:o});
50 this.hasSearch = true;
51 this.triggers[0].show();