~chiawen-ho/sahana-eden/test

« back to all changes in this revision

Viewing changes to static/scripts/ext-2.2.1/source/widgets/menu/DateItem.js

  • Committer: Tina
  • Date: 2010-08-01 09:45:20 UTC
  • Revision ID: tina@tina-vaio-20100801094520-iyifngvbd52k2dfc
initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 */
 
17
Ext.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
 
 
31
Ext.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
});
 
 
b'\\ No newline at end of file'