5 Roo.form.DateDisplay = function(config){
7 config.listener = config.listener || {};
8 var c = Roo.apply({}, config);
11 Roo.form.DateDisplay.superclass.constructor.call(this, config);
16 this.picker = new Roo.DatePicker( c );
21 * Fires when a date is selected
22 * @param {DatePicker} this
23 * @param {Date} date The selected date
28 * Fires when the displayed month changes
29 * @param {DatePicker} this
30 * @param {Date} date The selected month
36 this.picker.on('select', this.onSelect, this);
40 Roo.extend(Roo.form.DateDisplay , Roo.form.TextField , {
44 onRender : function(ct, position)
46 Roo.form.TextField.superclass.onRender.call(this, ct, position);
49 this.el.dom.value = this.value ? this.formatDate(this.value, 'Y-m-d') : '';
50 // prevent input submission
52 // now render the field..
53 this.wrap = this.el.wrap();
55 this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'});
57 this.picker.onRender(this.viewEl, position);
60 onSelect : function(sel) {
62 if (this.picker.value) {
63 this.setValue(this.picker.value.format('Y-m-d'));
64 //this.fireEvent('select', this);