Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / DisplayField.js
index 6be18a6..8b77ac0 100644 (file)
@@ -22,12 +22,9 @@ Roo.form.DisplayField = function(config){
 };
 
 Roo.extend(Roo.form.DisplayField, Roo.form.TextField,  {
-    fieldLabel:      '',
     inputType:      'hidden',
-    width:          50,
     allowBlank:     true,
-    labelSeparator: '',
-    hidden:         true,
+    readOnly:         true,
     
  
     /**
@@ -50,7 +47,7 @@ Roo.extend(Roo.form.DisplayField, Roo.form.TextField,  {
      * {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.DisplayField, 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);
@@ -107,6 +104,10 @@ Roo.extend(Roo.form.DisplayField, Roo.form.TextField,  {
     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);