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     
11 };
12
13 Roo.extend(Roo.form.DateDisplay , Roo.form.DateField ,  {
14     
15     inputType  : 'hidden',
16     
17     onRender : function(ct, position)
18     {
19         Roo.form.TextField.superclass.onRender.call(this, ct, position);
20         
21         
22         this.el.dom.value = this.value ? this.formatDate(this.value, 'Y-m-d') : '';
23         // prevent input submission
24         
25         // now render the field..  
26         this.wrap = this.el.wrap();
27         
28         this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'});
29         
30         this.picker.onRender(this.viewEl, position);
31         
32     }
33      
34     
35 });