PDA

View Full Version : Error while call TreeEditor constructor



tieuquan
1 Jul 2009, 3:46 PM
Hi geeks,
I'm really need your help.
I'm trying to use TreeEditor but I can't even create it. Here is my code:
...
final TreePanel treePanel = new OutlookTreePanel();
treePanel.setId("tree-panel-1");
TextField textfield = new TextField();
textfield.setSelectOnFocus(true);
textfield.setId("field-set-id");
RootPanel.get().add(treePanel);
TreeEditor treeEditor = new TreeEditor(treePanel, textfield);
...
(class OutlookTreePanel from Showcase2 example)

And here is the error that Firebug notified:

field is undefined
file ext-all-debug.js
Line 25005

Ext.Editor = function(field, config){
25005 if(field.field){ // error line
25006 this.field = Ext.create(field.field, 'textfield');
25007 config = Ext.apply({}, field); // copy so we don't disturb original config
25008 delete config.field;
25009 }else{
25010 this.field = field;
25011 }
25012 Ext.Editor.superclass.constructor.call(this, config);
25013};

So can anybody help me? Moreover, I can run in host mode normally, but this error comes when I run in web mode? So weird...