source: trunk/web/addons/job_monarch/lib/extjs/source/widgets/menu/DateItem.js @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 1.1 KB
Line 
1/*
2 * Ext JS Library 2.2.1
3 * Copyright(c) 2006-2009, Ext JS, LLC.
4 * licensing@extjs.com
5 *
6 * http://extjs.com/license
7 */
8
9/**
10 * @class Ext.menu.DateItem
11 * @extends Ext.menu.Adapter
12 * A menu item that wraps the {@link Ext.DatePicker} component.
13 * @constructor
14 * Creates a new DateItem
15 * @param {Object} config Configuration options
16 */
17Ext.menu.DateItem = function(config){
18    Ext.menu.DateItem.superclass.constructor.call(this, new Ext.DatePicker(config), config);
19    /** The Ext.DatePicker object @type Ext.DatePicker */
20    this.picker = this.component;
21    this.addEvents('select');
22   
23    this.picker.on("render", function(picker){
24        picker.getEl().swallowEvent("click");
25        picker.container.addClass("x-menu-date-item");
26    });
27
28    this.picker.on("select", this.onSelect, this);
29};
30
31Ext.extend(Ext.menu.DateItem, Ext.menu.Adapter, {
32    // private
33    onSelect : function(picker, date){
34        this.fireEvent("select", this, date, picker);
35        Ext.menu.DateItem.superclass.handleClick.call(this);
36    }
37});
Note: See TracBrowser for help on using the repository browser.