view resources/datetime/UX_DateTimeMenu.js @ 352:5fbcbf330839

Added documenation
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 13 Aug 2013 11:45:14 +0200
parents a282da79cfaa
children
line wrap: on
line source
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