转帖01

{
            region: 'west',
            collapsible:
true,
            title:
'导航菜单',
            xtype:
'treepanel',
            width:
200,
            autoScroll:
true,
            split:
true,
            loader:
new Ext.tree.TreeLoader({dataUrl:'tree.aspx'}),
            root: {
                nodeType:
'async',
                text :
'root',
                draggable :
false,
                id :
'0'
            },
            rootVisible :
false,
            listeners: {
                
'click':function(node, event) {   
                 event.stopEvent();   
                
var n = Ext.getCmp('tab').getComponent(node.id);   
                
if (!n&&node.attributes.href!=null) {
                    n
= Ext.getCmp('tab').add({
                      
'id':node.id,
                      
'title':node.text,
                       closable:
true,
                       autoLoad:{url:node.attributes.href, scripts:
true}
                    });   
                 }   
                 Ext.getCmp(
'tab').setActiveTab(n);
              }   
            }
        }



posted @ 2011-10-30 23:02  居后不争  阅读(116)  评论(0编辑  收藏  举报