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