1. #1
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default [2.2.x] Panel.setIconClass breaks for any collapsible panel

    [2.2.x] Panel.setIconClass breaks for any collapsible panel


    Reproduce:

    go to: http://extjs.com/deploy/dev/examples...t/complex.html
    observe icons for east, west, south and accordion panels.

    paste:
    Code:
    var icon = 'nav';
    Ext.getCmp('west-panel').setIconClass(icon); // East panel title bar
    Ext.getCmp('ext-comp-1017').setIconClass(icon); // East panel title bar
    Ext.getCmp('ext-comp-1018').setIconClass(icon); // South panel title bar
    Ext.getCmp('ext-comp-1019').setIconClass(icon); // First accordion
    It seems that the setIconClass method is incorrectly placing the img tag before the tool, which should be after.

    Quick override:
    Code:
    Ext.override(Ext.Panel, {
    	setIconClass : function(cls){
    		var old = this.iconCls;
    		this.iconCls = cls;
    		
    		if(this.rendered && this.header){
    			if(this.frame){
    				this.header.addClass('x-panel-icon');
    				this.header.replaceClass(old, this.iconCls);
    			}
    			else{
    				var hd = this.header.dom;
    				var img = hd.firstChild && String(hd.firstChild.tagName).toLowerCase() == 'img' ? hd.firstChild : null;
    
    				var insertWhere = 'insertBefore';
    			
    				if (this.collapsible || this.ownerCt.layout == 'accordion') {
    					/*
    						hd.firstChild is the tool icon for collapsing
    					*/
    					if (old) {
    						img = hd.childNodes[1] && String(hd.childNodes[1].tagName).toLowerCase() == 'img' ? hd.childNodes[1] : null;
    					}
    					else {
    						insertWhere = 'insertAfter';
    					}
    				}
    										
    				if(img){
    				   Ext.fly(img).replaceClass(old, this.iconCls);
    				}
    				else{
    					Ext.DomHelper[insertWhere](hd.firstChild, {
    						tag:'img', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+ this.iconCls
    					});
    				 }
    			}
    		}
    	}
    			 
    			 
    });

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    43
    Vote Rating
    0
    bloudon is on a distinguished road

      0  

    Default


    That override only works when the panel has a single tool.

    This worked better for me:

    Code:
    Ext.override(Ext.Panel, {
        setIconClass : function(cls){
            var old = this.iconCls;
            this.iconCls = cls;
            if(this.rendered && this.header){
                if(this.frame){
                    this.header.addClass('x-panel-icon');
                    this.header.replaceClass(old, this.iconCls);
                }else{
                    var img = this.header.child('.x-panel-inline-icon');
    
                    if (img) {
                        img.replaceClass(old, this.iconCls);
                    }else{
                        var tool = this.header.last('.x-tool');
    
                        if ( tool ) {
                            Ext.DomHelper.insertAfter(tool, {
                                tag: 'img', src: Ext.BLANK_IMAGE_URL,
                                cls: 'x-panel-inline-icon '+ this.iconCls
                            });
                        }
                        else {
                            Ext.DomHelper.insertBefore(this.header.dom.firstChild, {
                                tag: 'img', src: Ext.BLANK_IMAGE_URL,
                                cls: 'x-panel-inline-icon '+ this.iconCls
                            });
                        }
                     }
                }
            }
        }
    });

  3. #3
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Awesome. I have yet to construct something with more than one tool

  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Norway
    Posts
    106
    Vote Rating
    0
    Drayton is on a distinguished road

      0  

    Default


    I wonder why they didn't fix this in 2.2.1?

  5. #5
    Sencha User
    Join Date
    May 2007
    Posts
    191
    Vote Rating
    0
    temporary is on a distinguished road

      0  

    Default


    *bump*

    This is still not fixed in 2.3.0.
    Don't know if this is fixed in 3.0.0.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar