ux/DateDisplay.js
[roojs1] / ux / DateDisplay.js
1
2
3  
4            
5 Roo.form.DateDisplay = function(config){
6     
7     
8     Roo.form.DateDisplay.superclass.constructor.call(this, config);
9     this.picker = new Roo.DatePicker( config );
10     this.picker.on('select', this.onSelect, this);
11     
12 };
13
14 Roo.extend(Roo.form.DateDisplay , Roo.form.DateField ,  {
15     
16     inputType  : 'hidden',
17     
18     onRender : function(ct, position)
19     {
20         Roo.form.TextField.superclass.onRender.call(this, ct, position);
21         
22         
23         this.el.dom.value = this.value ? this.formatDate(this.value, 'Y-m-d') : '';
24         // prevent input submission
25         
26         // now render the field..  
27         this.wrap = this.el.wrap();
28         
29         this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'});
30         
31         this.picker.onRender(this.viewEl, position);
32         
33     },
34     onSelect : function(sel) {
35         this.fireEvent('select', this);
36         
37         
38      
39     }
40     
41 });