comparison app/view/widget/base/DateTimeField.js @ 649:1f51b6020f8c

Added new DateTimeFields.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 18 Mar 2015 13:54:18 +0100
parents
children 777bf66dbb11
comparison
equal deleted inserted replaced
648:199246596bf7 649:1f51b6020f8c
1 Ext.define('Lada.view.widget.base.DateTimeField', {
2 extend: 'Ext.form.field.Date',
3 alias: 'widget.datetimefield',
4 requires: [
5 'Lada.view.widget.base.DateTimePicker'
6 ],
7
8 format: 'm/d/Y H:i',
9
10 mimicBlur: function(e) {
11 var me = this,
12 picker = me.picker;
13
14 // ignore mousedown events within the picker element
15 if (!picker ||
16 !e.within(picker.el, false, true)
17 ) {
18 me.callParent(arguments);
19 }
20 },
21
22 collapseIf: function(e) {
23 var me = this;
24
25 if (Ext.getVersion().major === 4
26 && !me.isDestroyed
27 && !e.within(me.bodyEl, false, true)
28 && !e.within(me.picker.el, false, true)
29 ) {
30 me.collapse();
31 }
32 },
33
34 createPicker: function() {
35 var me = this;
36
37 return new Lada.view.widget.base.DateTimePicker({
38 pickerField: me,
39 floating: true,
40 hidden: true,
41 focusable: true,
42 focusOnShow: true,
43 minDate: me.minValue,
44 maxDate: me.maxDate,
45 disabledDatesRE: me.disabledDatesRE,
46 disabledDatesText: me.disabledDatesText,
47 disabledDays: me.disabledDays,
48 disabledDatesText: me.disabledDaysText,
49 format: me.format,
50 startDay: me.startDay,
51 minText: Ext.String.format(me.minText, me.formatDate(me.minValue)),
52 maxText: Ext.String.format(me.maxText, me.formatDate(me.maxValue)),
53 listeners: {
54 scope: me,
55 select: me.onSelect
56 },
57 keyNavConfig: {
58 esc: function() {
59 me.collapse();
60 }
61 }
62 });
63 }
64 });

http://lada.wald.intevation.org