Mercurial > lada > lada-client
diff resources/datetime/UX_DateTimeField.js @ 273:a282da79cfaa
Added datetimepicker from
http://www.sencha.com/forum/showthread.php?137242-Ext.ux.DateTimeField-DateTimePicker-for-ext4-also-DateTimeMenu-TimePickerField
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 07 Aug 2013 11:59:50 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resources/datetime/UX_DateTimeField.js Wed Aug 07 11:59:50 2013 +0200 @@ -0,0 +1,43 @@ +Ext.define('Ext.ux.form.DateTimeField', { + extend: 'Ext.form.field.Date', + alias: 'widget.datetimefield', + requires: ['Ext.ux.DateTimePicker'], + + initComponent: function() { + this.format = this.format + ' ' + 'H:i:s'; + this.callParent(); + }, + // overwrite + createPicker: function() { + var me = this, + format = Ext.String.format; + + return Ext.create('Ext.ux.DateTimePicker', { + ownerCt: me.ownerCt, + renderTo: document.body, + floating: true, + hidden: true, + focusOnShow: true, + minDate: me.minValue, + maxDate: me.maxValue, + disabledDatesRE: me.disabledDatesRE, + disabledDatesText: me.disabledDatesText, + disabledDays: me.disabledDays, + disabledDaysText: me.disabledDaysText, + format: me.format, + showToday: me.showToday, + startDay: me.startDay, + minText: format(me.minText, me.formatDate(me.minValue)), + maxText: format(me.maxText, me.formatDate(me.maxValue)), + listeners: { + scope: me, + select: me.onSelect + }, + keyNavConfig: { + esc: function() { + me.collapse(); + } + } + }); + } + }); \ No newline at end of file