3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
7 Ext.ns('Ext.ux.form');
\r
10 * @class Ext.ux.form.SpinnerField
\r
11 * @extends Ext.form.NumberField
\r
12 * Creates a field utilizing Ext.ux.Spinner
\r
13 * @xtype spinnerfield
\r
15 Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, {
\r
17 autoSize: Ext.emptyFn,
\r
18 onBlur: Ext.emptyFn,
\r
19 adjustSize: Ext.BoxComponent.prototype.adjustSize,
\r
21 constructor: function(config) {
\r
22 var spinnerConfig = Ext.copyTo({}, config, 'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass');
\r
24 var spl = this.spinner = new Ext.ux.Spinner(spinnerConfig);
\r
26 var plugins = config.plugins
\r
27 ? (Ext.isArray(config.plugins)
\r
28 ? config.plugins.push(spl)
\r
29 : [config.plugins, spl])
\r
32 Ext.ux.form.SpinnerField.superclass.constructor.call(this, Ext.apply(config, {plugins: plugins}));
\r
37 this.wrap.dom.style.display = '';
\r
38 this.wrap.dom.style.visibility = 'visible';
\r
43 this.wrap.dom.style.display = 'none';
\r
47 getResizeEl: function(){
\r
52 getPositionEl: function(){
\r
57 alignErrorIcon: function(){
\r
59 this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
\r
63 validateBlur: function(){
\r
68 Ext.reg('spinnerfield', Ext.ux.form.SpinnerField);
\r
71 Ext.form.SpinnerField = Ext.ux.form.SpinnerField;
\r