Mercurial > lada > lada-client
diff resources/lib/datetime/UX_DateTimeMenu.js @ 550:b6875e900e3a
Added datetime library.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 06 Mar 2015 12:44:44 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resources/lib/datetime/UX_DateTimeMenu.js Fri Mar 06 12:44:44 2015 +0100 @@ -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(); + } + });