5 Roo.form.DateDisplay = function(config){
8 Roo.form.DateDisplay.superclass.constructor.call(this, config);
9 this.picker = new Roo.DatePicker( config );
14 * Fires when a date is selected
15 * @param {DatePicker} this
16 * @param {Date} date The selected date
21 * Fires when the displayed month changes
22 * @param {DatePicker} this
23 * @param {Date} date The selected month
29 this.picker.on('select', this.onSelect, this);
33 Roo.extend(Roo.form.DateDisplay , Roo.form.TextField , {
37 onRender : function(ct, position)
39 Roo.form.TextField.superclass.onRender.call(this, ct, position);
42 this.el.dom.value = this.value ? this.formatDate(this.value, 'Y-m-d') : '';
43 // prevent input submission
45 // now render the field..
46 this.wrap = this.el.wrap();
48 this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'});
50 this.picker.onRender(this.viewEl, position);
53 onSelect : function(sel) {
55 if (this.datepicker.value) {
56 this.setValue(this.datepicker.value.format('Y-m-d'));
57 this.fireEvent('select', this);