3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
15 Ext.ns('Ext.ux.form');
17 Ext.ux.form.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
18 initComponent : function(){
19 Ext.ux.form.SearchField.superclass.initComponent.call(this);
20 this.on('specialkey', function(f, e){
21 if(e.getKey() == e.ENTER){
22 this.onTrigger2Click();
27 validationEvent:false,
29 trigger1Class:'x-form-clear-trigger',
30 trigger2Class:'x-form-search-trigger',
36 onTrigger1Click : function(){
38 this.el.dom.value = '';
40 this.store.baseParams = this.store.baseParams || {};
41 this.store.baseParams[this.paramName] = '';
42 this.store.reload({params:o});
43 this.triggers[0].hide();
44 this.hasSearch = false;
48 onTrigger2Click : function(){
49 var v = this.getRawValue();
51 this.onTrigger1Click();
55 this.store.baseParams = this.store.baseParams || {};
56 this.store.baseParams[this.paramName] = v;
57 this.store.reload({params:o});
58 this.hasSearch = true;
59 this.triggers[0].show();