1. #1
    Ext User
    Join Date
    Jul 2009
    Posts
    8
    Vote Rating
    0
    wora is on a distinguished road

      0  

    Question Internet Explorer 8, width of menu items to small

    In IE8 (and IE8 compatibility mode) the width of my menu items is fixed (and too small); in Opera or FF the width adapts to the length of the text.
    Is there anything I can do, to have a fitting length in IE also?

    Wolfgang

    PS: My typical code for a menu element:
    ------------
    Code:
    {
    	text: 'Auswertungen',
    	menu: new Ext.menu.Menu({
    		id: 'main_stat',
    		text: 'Auswert',
    		items: [ actionVergleich('vergleich_pp'),
    			actionVergleich_subid('vergleich_subid'),
    			actionVergleich_domain('vergleich_domain'),
    			actionErfolgeAnzeigen('erfolge_monat'),
    			actionPartnerMonatsUebersichtAnzeigen
    		]
    	})
    },
    ------------

  2. #2
    Ext User
    Join Date
    Feb 2008
    Posts
    200
    Vote Rating
    2
    tomcheng76 is on a distinguished road

      0  

    Default

    are you using version 2.3?
    or you may need this
    Code:
     	Ext.override(Ext.menu.Menu, { 
    	 	        autoWidth : function(){ 
    	 	                var ua = navigator.userAgent.toLowerCase(); 
    	 	                var isIE8 = !Ext.isOpera && ua.indexOf("msie 8") > -1; 
    	 	                var el = this.el, ul = this.ul; 
    	 	                if(!el){ 
    	 	                        return; 
    	 	                } 
    	 	                var w = this.width; 
    	 	                if(w){ 
    	 	                        el.setWidth(w); 
    	 	                }else if(Ext.isIE && !isIE8){ 
    	 	                        el.setWidth(this.minWidth); 
    	 	                        var t = el.dom.offsetWidth; // force recalc 
    	 	                        el.setWidth(ul.getWidth()+el.getFrameWidth("lr")); 
    	 	                } 
    	 	        } 
    	 });
    or upgrade your ext js version if you want.

  3. #3
    Ext User
    Join Date
    Jul 2009
    Posts
    8
    Vote Rating
    0
    wora is on a distinguished road

      0  

    Talking

    I'm still working with 2.2.1.
    I tried your fix (it helped, of course) and will later switch to 2.3

    Thanks a lot

    Wolfgang

Thread Participants: 1