remove debugging code
[roojs1] / Roo / tree / TreeEditor.js
index 3b816ed..33734b5 100644 (file)
  * @constructor
  * @param {Object} config (used to be the tree panel.)
  * @param {Object} oldconfig DEPRECIATED Either a prebuilt {@link Roo.form.Field} instance or a Field config object
+ * 
  * @cfg {Roo.tree.TreePanel} tree The tree to bind to.
  * @cfg {Roo.form.TextField|Object} field The field configuration
+ *
  * 
  */
 Roo.tree.TreeEditor = function(config, oldconfig) { // was -- (tree, config){
@@ -29,13 +30,12 @@ Roo.tree.TreeEditor = function(config, oldconfig) { // was -- (tree, config){
     } else {
         // new style..
         tree = config.tree;
-        fieldcfg = config.field || {};
-        field = config.field && config.field ? config : new Roo.form.TextField(fieldcfg);
-    
-        
+        config.field = config.field  || {};
+        config.field.xtype = 'TextField';
+        field = Roo.factory(config.field, Roo.form);
     }
     config = config || {};
-    var field = config.events ? config : new Roo.form.TextField(fieldcfg);
+    
     
     this.addEvents({
         /**
@@ -48,7 +48,7 @@ Roo.tree.TreeEditor = function(config, oldconfig) { // was -- (tree, config){
         "beforenodeedit" : true
     });
     
-    Roo.log(config);
+    //Roo.log(config);
     Roo.tree.TreeEditor.superclass.constructor.call(this, field, config);
 
     this.tree = tree;
@@ -132,6 +132,7 @@ Roo.extend(Roo.tree.TreeEditor, Roo.Editor, {
             this.triggerEdit(node);
             return false;
         }
+        return true;
     },
 
     // private