1. #1
    Ext User
    Join Date
    Oct 2007
    Posts
    5
    Vote Rating
    0
    maodenny is on a distinguished road

      0  

    Default add one treepanel to accordion,it's ok,but two treepanel ,it can't render correctly

    add one treepanel to accordion,it's ok,but two treepanel ,it can't render correctly


    HI

    When I add one treepanel to accordion as desktop example,it's ok,but when I try add two treepanel to accordion ,it can't render correctly .The second treepanel looks like panel. Why???

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,544
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    What layout are you giving that accordion Panel?

    It will need some kind of layout which can manage multiple child Components. Perhaps you want the two TreePanels to be two tabs of a TabPanel???

  3. #3
    Ext User
    Join Date
    Oct 2007
    Posts
    5
    Vote Rating
    0
    maodenny is on a distinguished road

      0  

    Default


    I want add treepanel to each accordion,when I add one tree to accordion just like desktop example,it's ok,the code :
    PHP Code:
    Ext.onReady
    (
    function()
    {
     var 
    root = new Ext.tree.TreeNode({
            
    text'report',
            
    allowDrag:false,
            
    allowDrop:false
        
    });
        
        var 
    tc = new Ext.tree.TreeNode({text:'a',allowDrag:false});
            
        
    root.appendChild(tc,tp,ts );
        
     
        
       var 
    tree1 =      new Ext.tree.TreePanel
                
    (
                 { 
                  
    title:'report1',
                          
    autoScroll:true,
                          
    border:false,
                          
    iconCls:'nav',
                  
    split:true,
                  
    width200,
                  
    minSize175,
                  
    maxSize400,
                  
    collapsibletrue,
                  
    margins:'0 0 0 0',
                  
    root:root
                 
    }
                );
                
                
       var 
    tree2 =      new Ext.tree.TreePanel
                
    (
                 { 
                  
    title:'report2',
                          
    autoScroll:true,
                          
    border:false,
                          
                  
    split:true,
                  
                  
    collapsibletrue
                  
                  
                 
    }
                );
                
                
       var 
    westpanel = new Ext.Panel ({
                    
    region:'west',
                    
                    
    title:'menu',
                    
    split:true,
                    
    width200,
                    
    minSize175,
                    
    maxSize400,
                    
    collapsibletrue,
                    
    margins:'0 0 5 5',
                    
    cmargins:'35 5 5 5',
                    
    layout:'accordion',
                    
    layoutConfig:
                    {
                        
    animate:false
                    
    },
                    
    items
                    [ 
    tree1
                     
    ,
                     {  
    title'ddd',
                          
    autoLoad:'',
                             
    autoScroll:true
                               
    }
                     
                
                    ]
               });  
     var 
    viewport = new Ext.Viewport
     
    (
      {
         
    layout:'border',
         
    items:
         [
              {
                             
    border:false,
                             
    region:'north',
                             
    contentEl:'north-div',
                             
    height:26
                      
    },
            
            
    westpanel,
            
            {
                             
    border:false,
                             
    region:'center',
                             
    contentEl:'center-div',
                             
    height:26
                      
    },
                          {
                                 
    region:'south',
                                 
    contentEl:'south-div',
                                  
    height:28,
                       
    margins:'0 0 0 0'
                           
    }
         ]
      }
     );
     }
     
     ) 
    but when I want to add second tree to the accordin,it can't render correctly

    PHP Code:
    var westpanel = new Ext.Panel ({
                    
    region:'west',
                    
                    
    title:'menu',
                    
    split:true,
                    
    width200,
                    
    minSize175,
                    
    maxSize400,
                    
    collapsibletrue,
                    
    margins:'0 0 5 5',
                    
    cmargins:'35 5 5 5',
                    
    layout:'accordion',
                    
    layoutConfig:
                    {
                        
    animate:false
                    
    },
                    
    items
                    [ 
    tree1
                     
    ,
                     
    tree2,
                     {  
    title'ddd',
                          
    autoLoad:'',
                             
    autoScroll:true
                               
    }
                     
                
                    ]
               }); 
    Help me please!!!

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,544
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    That looks OK.

    What exactly does the problem entail? Can you post a link to a working example? Or cut down your page into something that will drop into the examples directory so we can test it?

  5. #5
    Ext User
    Join Date
    Oct 2007
    Posts
    5
    Vote Rating
    0
    maodenny is on a distinguished road

      0  

    Default


    I solved the problem.If the root of the second treepanel is same as the first treepanel's ,or isn't set ,it will not render correctly.
    Thanks !!!!!!!

Thread Participants: 1