Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default [FIXED]Menu Item does not respect cls property

    [FIXED]Menu Item does not respect cls property


    look here:
    http://localhost/ext4/examples/form/form-grid.html

    when you call a header menu, there are no icons displayed. Inspecting the image tag they are base64 encoded now, but doesn't work. Example:
    Code:
    <img class="x-menu-item-icon " src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" id="ext-gen1123">
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  2. #2
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    72
    Vote Rating
    0
    kaigan is on a distinguished road

      0  

    Default


    Code:
    data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==
    is Ext.BLANK_IMAGE_URL, icons in menus are supposed to come from the cls/css
    -

  3. #3
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    ok, but how should it work? There is no identifier class, the link now has class
    x-menu-item-link

    Compare to Ext3 the link was
    x-menu-item xg-hmenu-sort-asc
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    looking to the source, the classes are set
    Code:
    menuItems.unshift({
    	itemId: 'ascItem',
    	text: me.sortAscText,
    	cls: 'xg-hmenu-sort-asc',
    	handler: me.onSortAscClick,
    	scope: me
    },{
    	itemId: 'descItem',
    	text: me.sortDescText,
    	cls: 'xg-hmenu-sort-desc',
    	handler: me.onSortDescClick,
    	scope: me
    },'-');
    so the bug is in menu render, cls isn't applied.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    and here is the fix - simply forgotten cls property in Ext.menu.Item:
    Code:
    initComponent: function() {
    	var me = this,
    		prefix = Ext.baseCSSPrefix;
    
    	me.addEvents(
    		/**
    		 * @event activate
    		 * Fires when this item is activated
    		 * @param {Ext.menu.Item} item The activated item
    		 */
    		'activate',
    
    		/**
    		 * @event click
    		 * Fires when this item is clicked
    		 * @param {Ext.menu.Item} item The item that was clicked
    		 * @param {Ext.EventObject} e The underyling {@link Ext.EventObject}.
    		 */
    		'click',
    
    		/**
    		 * @event deactivate
    		 * Fires when this tiem is deactivated
    		 * @param {Ext.menu.Item} item The deactivated item
    		 */
    		'deactivate'
    	);
    
    	var cls = [prefix + 'menu-item'];
    
    	if (me.plain) {
    		cls.push(prefix + 'menu-item-plain');
    	}
    
    	if (me.cls) {
    		cls.push(me.cls);
    	}
    	
    	me.cls = cls.join(' ');
    
    	if (me.menu) {
    		me.menu = Ext.menu.MenuManager.get(me.menu);
    	}
    
    	me.callParent(arguments);
    },
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,046
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Indeed. Fixed!
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Similar Threads

  1. Replies: 2
    Last Post: 6 May 2010, 8:32 AM
  2. Replies: 8
    Last Post: 12 Feb 2010, 9:30 AM
  3. Replies: 6
    Last Post: 25 Aug 2009, 5:33 AM
  4. Menu.item hidden property undefined?
    By SlashEMc2k in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 23 Nov 2007, 11:25 AM
  5. Replies: 0
    Last Post: 31 Jul 2007, 4:54 PM

Thread Participants: 2