Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / DisplayField.js
index b747b5b..8b77ac0 100644 (file)
  * Creates a new Display Field item.
  * @param {Object} config Configuration options
  */
-Roo.form.DisplayText = function(config){
-    Roo.form.DisplayText.superclass.constructor.call(this, config);
+Roo.form.DisplayField = function(config){
+    Roo.form.DisplayField.superclass.constructor.call(this, config);
     
 };
 
-Roo.extend(Roo.form.DisplayText, Roo.form.TextField,  {
-    fieldLabel:      '',
+Roo.extend(Roo.form.DisplayField, Roo.form.TextField,  {
     inputType:      'hidden',
-   // width:          50,
     allowBlank:     true,
-    labelSeparator: '',
-    hidden:         true,
+    readOnly:         true,
     
  
     /**
@@ -49,8 +46,8 @@ Roo.extend(Roo.form.DisplayText, Roo.form.TextField,  {
      * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
      * {tag: "input", type: "checkbox", autocomplete: "off"})
      */
-   /*  
-    defaultAutoCreate : { tag: 'input', type: 'hidden', autocomplete: 'off'},
+     
//   defaultAutoCreate : { tag: 'input', type: 'hidden', autocomplete: 'off'},
 
     onResize : function(){
         Roo.form.DisplayField.superclass.onResize.apply(this, arguments);
@@ -74,12 +71,12 @@ Roo.extend(Roo.form.DisplayText, Roo.form.TextField,  {
 
     // private
     onRender : function(ct, position){
+        
         Roo.form.DisplayField.superclass.onRender.call(this, ct, position);
         //if(this.inputValue !== undefined){
-        
-        
         this.wrap = this.el.wrap();
-        this.viewEl = this.wrap.createChild({ tag: 'div'});
+        
+        this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'});
         
         if (this.bodyStyle) {
             this.viewEl.applyStyles(this.bodyStyle);
@@ -89,7 +86,6 @@ Roo.extend(Roo.form.DisplayText, Roo.form.TextField,  {
         this.setValue(this.value);
         
     },
-    */
 /*
     // private
     initValue : Roo.emptyFn,
@@ -97,7 +93,6 @@ Roo.extend(Roo.form.DisplayText, Roo.form.TextField,  {
   */
 
        // private
-    
     onClick : function(){
         
     },
@@ -106,13 +101,15 @@ Roo.extend(Roo.form.DisplayText, Roo.form.TextField,  {
      * Sets the checked state of the checkbox.
      * @param {Boolean/String} checked True, 'true', '1', or 'on' to check the checkbox, any other value will uncheck it.
      */
-     /*
     setValue : function(v){
         this.value = v;
         var html = this.valueRenderer ?  this.valueRenderer(v) : String.format('{0}', v);
+        // this might be called before we have a dom element..
+        if (!this.viewEl) {
+            return;
+        }
         this.viewEl.dom.innerHTML = html;
         Roo.form.DisplayField.superclass.setValue.call(this, v);
 
     }
-    */
 });
\ No newline at end of file