X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..e9397f91ede62d446aed37d23256e8938fc4c335:/examples/ux/SearchField.js diff --git a/examples/ux/SearchField.js b/examples/ux/SearchField.js index bbe31dbc..d0f380f3 100644 --- a/examples/ux/SearchField.js +++ b/examples/ux/SearchField.js @@ -1,53 +1,53 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ -Ext.ns('Ext.ux.form'); - -Ext.ux.form.SearchField = Ext.extend(Ext.form.TwinTriggerField, { - initComponent : function(){ - Ext.ux.form.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(); - } +Ext.ns('Ext.ux.form'); + +Ext.ux.form.SearchField = Ext.extend(Ext.form.TwinTriggerField, { + initComponent : function(){ + Ext.ux.form.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