Results 1 to 5 of 5

Thread: [2.0.1][CLOSED] TabPanel closing

  1. #1
    Sencha User
    Join Date
    Apr 2007
    Posts
    49

    Default [2.0.1][CLOSED] TabPanel closing

    ExtJS 2.0.1
    Bug: Only FF2, not IE

    If I click the close on the last remaining tab of a panel in a TabPanel which the content pane of a BorderLayout viewport, I get the following error in FF2 (From Firebug):

    Code:
    item has no properties
    findTargets(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all-debug.js (line 18510)
    onStripClick(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all-debug.js (line 18541)
    h(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all-debug.js (line 1629)
    getViewWidth(click clientX=0, clientY=0)ext-base.js (line 10)
    [Break on this error] if(item.disabled){
    The specific error is on line 18510 where it is assumed that the item has been found in 18509:
    Code:
     findTargets : function(e){
    18506 var item = null;
    18507 var itemEl = e.getTarget('li', this.strip);
    18508 if(itemEl){
    18509 item = this.getComponent(itemEl.id.split(this.idDelimiter)[1]);
    18510 if(item.disabled){
    18511 return {
    18512 close : null,
    18513 item : null,
    18514 el : null
    18515 };
    18516 }
    18517 }
    18518
    Last edited by Green; 6 Feb 2008 at 4:13 AM. Reason: Closing
    Production: Ext4/Touch2

    "Real programmers use C: >copy con > myprog.exe"

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    I can't reproduce this error. Could you post an example?

    ps. Closing all tabs isn't officially supported and there are some known problems.

    The following overrides will fix the issues known to me:

    Code:
    Ext.override(Ext.layout.CardLayout, {
        setActiveItem : function(item){
            item = this.container.getComponent(item);
            if(this.activeItem != item){
                if(this.activeItem){
                    this.activeItem.hide();
                }
                this.activeItem = item;
                if (item){
                	item.show();
                }
                this.layout();
            }
        }
    });
    
    Ext.override(Ext.TabPanel, {
        setActiveTab : function(item){
            item = this.getComponent(item);
            if(
                //!item ||
                this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
                return;
            }
            if(!this.rendered){
                this.activeTab = item;
                return;
            }
            if(this.activeTab != item){
                if(this.activeTab){
                    var oldEl = this.getTabEl(this.activeTab);
                    if(oldEl){
                        Ext.fly(oldEl).removeClass('x-tab-strip-active');
                    }
                    this.activeTab.fireEvent('deactivate', this.activeTab);
                }
                this.activeTab = item;
                this.layout.setActiveItem(item);
                if(item){
                	var el = this.getTabEl(item);
                	Ext.fly(el).addClass('x-tab-strip-active');
    
                	this.stack.add(item);
    
                	if(this.layoutOnTabChange && item.doLayout){
    	                item.doLayout();
        	        }
                	if(this.scrolling){
                	    this.scrollToTab(item, this.animScroll);
                	}
                	item.fireEvent('activate', item);
                }
                this.fireEvent('tabchange', this, item);
            }
        }
    });

  3. #3
    Sencha User
    Join Date
    Apr 2007
    Posts
    49

    Default [CLOSED]

    For some unknown reason your code overrides seems to fix the issue! Personally I thought the issue was due to a timing issue, i.e. in IE the elements are still hanging around but not in FF. However it may be...Thanks much.
    Production: Ext4/Touch2

    "Real programmers use C: >copy con > myprog.exe"

  4. #4
    Sencha User sksoft's Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    34

    Default Ignoring hotfix

    Ext Developers, why you ignore this hotfix in 2.2.1?

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    This should already be resolved, please post a test case to demonstrate the issue if it isn't.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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