diff resources/datetime/UX_DateTimeMenu.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_DateTimeMenu.js	Wed Aug 07 11:59:50 2013 +0200
@@ -0,0 +1,39 @@
+Ext.define('Ext.ux.DateTimeMenu', {
+	  extend: 'Ext.menu.Menu',
+	  
+	  alias: 'widget.datetimemenu',
+	  
+	  requires: ['Ext.ux.DateTimePicker'],
+	  
+	  hideOnClick: true,
+	  pickerId: null,
+	  
+	  initComponent: function() {
+		  var me = this;
+		  
+		  Ext.apply(me, {
+			    showSeparator: false,
+			    plain: true,
+			    border: false,
+			    bodyPadding: 0,
+			    items: Ext.applyIf({
+				      cls: Ext.baseCSSPrefix + 'menu-date-item',
+				      id: me.pickerId,
+				      xtype: 'datetimepicker'
+			      }, me.initialConfig)
+		    });
+		  
+		  me.callParent(arguments);
+		  
+		  me.picker = me.down('datetimepicker');
+		  me.relayEvents(me.picker, ['select']);
+		  
+		  if (me.hideOnClick) {
+			  me.on('select', me.hidePickerOnSelect, me);
+		  }
+	  },
+	  
+	  hidePickerOnSelect: function() {
+		  Ext.menu.Manager.hideAll();
+	  }
+  });

http://lada.wald.intevation.org