PDA

View Full Version : HELP! Problem with Treepanel



ivanzhaowy
17 Jun 2010, 1:33 AM
I use EXT Designer generated a layout, and then add event listeners to the components like below:


PXM_Viewport = Ext.extend(PXM_ViewportUi, {
initComponent : function() {
PXM_Viewport.superclass.initComponent.call(this);
},
show : function() {
Ext.fly('pxm-production-projects-selector').addListener(
'keyup', function() {
Ext.get('pxm-production-projects-tree').enable();
});
Ext.fly('pxm-production-projects-selector').addListener(
'select', function() {
});

}
});

Here comes the question:
pxm-production-projects-selector is a combobox, these two listeners works correctly, but 'Ext.get('pxm-production-projects-tree').enable();' throw out 'Ext.get("pxm-production-projects-tree").enable is not a function'. But hide() and show() works correctly here. Any one can help me?

Animal
17 Jun 2010, 1:49 AM
How have you debugged?

ivanzhaowy
17 Jun 2010, 1:55 AM
Yes, but I can't find what's wrong. Like I said Ext.get('pxm-production-projects-tree').hide() works correctly, but enable() throw out 'Ext.get("pxm-production-projects-tree").enable is not a function'. .'pxm-production-projects-tree' is a treepanel.

evant
17 Jun 2010, 1:57 AM
I'd suggest you read the docs under Element.get, specifically the part in bold ;)

Animal
17 Jun 2010, 2:31 AM
Yes, but I can't find what's wrong. Like I said Ext.get('pxm-production-projects-tree').hide() works correctly, but enable() throw out 'Ext.get("pxm-production-projects-tree").enable is not a function'. .'pxm-production-projects-tree' is a treepanel.

The question was how have you debugged?

Running it and looking at it is not debugging.

ivanzhaowy
25 Jun 2010, 1:58 AM
I'd suggest you read the docs under Element.get, specifically the part in bold ;)

thx! I know what to do now.