3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
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
18 autoSize: Ext.emptyFn,
\r
19 onBlur: Ext.emptyFn,
\r
20 adjustSize: Ext.BoxComponent.prototype.adjustSize,
\r
22 constructor: function(config) {
\r
23 var spinnerConfig = Ext.copyTo({}, config, 'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass');
\r
25 var spl = this.spinner = new Ext.ux.Spinner(spinnerConfig);
\r
27 var plugins = config.plugins
\r
28 ? (Ext.isArray(config.plugins)
\r
29 ? config.plugins.push(spl)
\r
30 : [config.plugins, spl])
\r
33 Ext.ux.form.SpinnerField.superclass.constructor.call(this, Ext.apply(config, {plugins: plugins}));
\r
38 this.wrap.dom.style.display = '';
\r
39 this.wrap.dom.style.visibility = 'visible';
\r
44 this.wrap.dom.style.display = 'none';
\r
48 getResizeEl: function(){
\r
53 getPositionEl: function(){
\r
58 alignErrorIcon: function(){
\r
60 this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
\r
64 validateBlur: function(){
\r
69 Ext.reg('spinnerfield', Ext.ux.form.SpinnerField);
\r
72 Ext.form.SpinnerField = Ext.ux.form.SpinnerField;
\r