Results 1 to 3 of 3

Thread: [SOLVED]tabs event "active","deactive" etc... not wok

  1. #1
    Ext User
    Join Date
    May 2007
    Posts
    22

    Default [SOLVED]tabs event "active","deactive" etc... not wok

    http://outdoor.no-ip.biz/ybh/index.html
    http://outdoor.no-ip.biz/ybh/tree_panel_simple.js
    http://outdoor.no-ip.biz/ybh/page_layout.js
    full package here http://outdoor.no-ip.biz/ybh.rar

    the main function is compare with 2 books at same View.
    and most 5 Views

    To use compare books ,just drag left tree's book name into right Views area.
    First time when you drag in,Views area will split become 2 frame,
    the book will display in bottom frame,next time you drag book into which frame,the frame will auto do AJAX call.

    now I have a problem,when you click on book,Views area's top frame will do AJAX call,but when you added a new tab(ex:View2),the book's click event will always fired at View2 .
    I try to use panel's 'active' event to change what panel is active now,but also get the same result
    PHP Code:
    //line 25 at page_layout.js
    var topView=new Ext.ContentPanel(dragTargetID, {titledragTargetIDclosablefalse});
    topView.on('active',setPanel(topView)); 
    Does anybody know why the active event not work currectly?
    Attached Files Attached Files
    Last edited by trowa; 5 Jul 2007 at 4:06 AM. Reason: added js link

  2. #2
    Ext User
    Join Date
    May 2007
    Posts
    22

    Default

    attached files

    someone can try it plz

  3. #3
    Ext User
    Join Date
    May 2007
    Posts
    22

    Default

    Sloved by myself...


    page_layout.js
    PHP Code:
    //page_layout.js

    //...
    var topView=new Ext.ContentPanel(dragTargetID, {titledragTargetIDclosablefalse});
            
    currentPanel=topView.getUpdateManager();
            
    innerLayout.add('center'topView);
    //...


    Ext.get('addTabBtn').on('click', function(){
            if(
    ViewAmount<5){
                
    layout.add('center',dt('View'+(++ViewAmount)));
                var 
    tabs=layout.getRegion('center').getTabs();
                
    //add tabechange event,when tab change ,it can update what panel is active now
                
    if(!tabs.hasListener('tabchange')){
                    
    tabs.addEvents('tabchange');
                    
    tabs.addListener('tabchange',function(){
                        
    //currentPanel is the panel's UpdateManager which is active now
                        
    currentPanel=Ext.get(tabs.getActiveTab().id.substring(0,5)).getUpdateManager();
                    });
                }
            }
            else{
                
    alert('sorry ,only 5 views at the same time');
            }
        }); 
    tree_panel_simple.js
    PHP Code:
    //tree_panel_simple.js


    //currentPanel is global var
    el.on('click',function(){
                
    currentPanel.update({
                    
    url'response.php?id='+this.node.id+'&',
                    
    text"Loading...",
                    
    timeout30,
                    
    scriptsfalse
                
    });
            },
    this); 
    Attached Files Attached Files
    Last edited by trowa; 5 Jul 2007 at 5:02 PM. Reason: fixed comment for "gup" ,the var dose not exist

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •