3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">Ext.ns('Ext.ux.form');
\r
10 <div id="cls-Ext.ux.form.SpinnerField"></div>/**
\r
11 * @class Ext.ux.form.SpinnerField
\r
12 * @extends Ext.form.NumberField
\r
13 * Creates a field utilizing Ext.ux.Spinner
\r
14 * @xtype spinnerfield
\r
16 Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, {
\r
19 autoSize: Ext.emptyFn,
\r
20 onBlur: Ext.emptyFn,
\r
21 adjustSize: Ext.BoxComponent.prototype.adjustSize,
\r
23 constructor: function(config) {
\r
24 var spinnerConfig = Ext.copyTo({}, config, 'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass');
\r
26 var spl = this.spinner = new Ext.ux.Spinner(spinnerConfig);
\r
28 var plugins = config.plugins
\r
29 ? (Ext.isArray(config.plugins)
\r
30 ? config.plugins.push(spl)
\r
31 : [config.plugins, spl])
\r
34 Ext.ux.form.SpinnerField.superclass.constructor.call(this, Ext.apply(config, {plugins: plugins}));
\r
38 getResizeEl: function(){
\r
43 getPositionEl: function(){
\r
48 alignErrorIcon: function(){
\r
50 this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
\r
54 validateBlur: function(){
\r
59 Ext.reg('spinnerfield', Ext.ux.form.SpinnerField);
\r
62 Ext.form.SpinnerField = Ext.ux.form.SpinnerField;
\r