Mercurial > lada > lada-client
annotate resources/lib/datetime/UX_TimePickerField.js @ 623:19d81c9aa97f
anchored all elements, to make them the same size, added a margin of 1px to the frame around the fieldset to prevent the cuttoff on the right side
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Mon, 16 Mar 2015 11:12:10 +0100 |
parents | b6875e900e3a |
children |
rev | line source |
---|---|
550
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /** |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * 时间输入框, 三个整数框分别输入时,分,秒. |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * @author wangzilong |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * update Ext - 4.1 2012/04/27 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 */ |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 Ext.define('Ext.ux.form.TimePickerField', { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 extend: 'Ext.form.field.Base', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 alias: 'widget.timepicker', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 alternateClassName: 'Ext.form.field.TimePickerField', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 requires: ['Ext.form.field.Number'], |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 // 隐藏BaseField的输入框 , hidden basefield's input |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 inputType: 'hidden', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 style: 'padding:4px 0 0 0;margin-bottom:0px', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 /** |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 * @cfg {String} value |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 * initValue, format: 'H:i:s' |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 */ |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 value: null, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 /** |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 * @cfg {Object} spinnerCfg |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 * 数字输入框参数, number input config |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 */ |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 spinnerCfg: { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 width: 40 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 /** Override. */ |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 initComponent: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 var me = this; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 me.value = me.value || Ext.Date.format(new Date(), 'H:i:s'); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 me.callParent();// called setValue |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 me.spinners = []; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 var cfg = Ext.apply({}, me.spinnerCfg, { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 readOnly: me.readOnly, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 disabled: me.disabled, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 style: 'float: left', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 listeners: { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 change: { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 fn: me.onSpinnerChange, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 scope: me |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 }); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 me.hoursSpinner = Ext.create('Ext.form.field.Number', Ext.apply({}, cfg, { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 minValue: 0, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 maxValue: 23 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 })); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 me.minutesSpinner = Ext.create('Ext.form.field.Number', Ext.apply({}, cfg, { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 minValue: 0, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 maxValue: 59 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 })); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 // TODO 使用timeformat 判断是否创建秒输入框, maybe second field is not always need. |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 me.secondsSpinner = Ext.create('Ext.form.field.Number', Ext.apply({}, cfg, { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 minValue: 0, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 maxValue: 59 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 })); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 me.spinners.push(me.hoursSpinner, me.minutesSpinner, me.secondsSpinner); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 /** |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 * @private |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 * Override. |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 */ |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 onRender: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 var me = this, spinnerWrapDom, spinnerWrap; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 me.callParent(arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 // render to original BaseField input td |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 // spinnerWrap = Ext.get(Ext.DomQuery.selectNode('div', this.el.dom)); // 4.0.2 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 spinnerWrapDom = Ext.dom.Query.select('td', this.getEl().dom)[1]; // 4.0 ->4.1 div->td |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 spinnerWrap = Ext.get(spinnerWrapDom); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 me.callSpinnersFunction('render', spinnerWrap); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 Ext.core.DomHelper.append(spinnerWrap, { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 tag: 'div', |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 cls: 'x-form-clear-left' |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 }); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 this.setRawValue(this.value); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 _valueSplit: function(v) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 if(Ext.isDate(v)) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 v = Ext.Date.format(v, 'H:i:s'); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 var split = v.split(':'); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 return { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 h: split.length > 0 ? split[0] : 0, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 m: split.length > 1 ? split[1] : 0, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 s: split.length > 2 ? split[2] : 0 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 }; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 onSpinnerChange: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 if(!this.rendered) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 return; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 this.fireEvent('change', this, this.getValue(), this.getRawValue()); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 // 依次调用各输入框函数, call each spinner's function |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 callSpinnersFunction: function(funName, args) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 for(var i = 0; i < this.spinners.length; i++) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 this.spinners[i][funName](args); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
112 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 // @private get time as object, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
115 getRawValue: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
116 if(!this.rendered) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
117 var date = this.value || new Date(); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 return this._valueSplit(date); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 } else { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 return { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 h: this.hoursSpinner.getValue(), |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 m: this.minutesSpinner.getValue(), |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 s: this.secondsSpinner.getValue() |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 }; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 // private |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 setRawValue: function(value) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 value = this._valueSplit(value); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 if(this.hoursSpinner) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 this.hoursSpinner.setValue(value.h); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 this.minutesSpinner.setValue(value.m); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 this.secondsSpinner.setValue(value.s); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 getValue: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 var v = this.getRawValue(); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 return Ext.String.leftPad(v.h, 2, '0') + ':' + Ext.String.leftPad(v.m, 2, '0') + ':' |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
141 + Ext.String.leftPad(v.s, 2, '0'); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
142 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
143 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 setValue: function(value) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 this.value = Ext.isDate(value) ? Ext.Date.format(value, 'H:i:s') : value; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 if(!this.rendered) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 return; |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 this.setRawValue(this.value); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 this.validate(); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
151 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 disable: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 this.callParent(arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 this.callSpinnersFunction('disable', arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
158 enable: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
159 this.callParent(arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 this.callSpinnersFunction('enable', arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 setReadOnly: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 this.callParent(arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 this.callSpinnersFunction('setReadOnly', arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 clearInvalid: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
169 this.callParent(arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 this.callSpinnersFunction('clearInvalid', arguments); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
171 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
172 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
173 isValid: function(preventMark) { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
174 return this.hoursSpinner.isValid(preventMark) && this.minutesSpinner.isValid(preventMark) |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
175 && this.secondsSpinner.isValid(preventMark); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
176 }, |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
177 // overwrite |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
178 validate: function() { |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
179 return this.hoursSpinner.validate() && this.minutesSpinner.validate() && this.secondsSpinner.validate(); |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
180 } |
b6875e900e3a
Added datetime library.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
181 }); |