Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,407
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default [FIXED][3.0] Menu getItemArgs (isXType vs instanceof)

    [FIXED][3.0] Menu getItemArgs (isXType vs instanceof)


    I suppose this one may be considered a difference of opinion, but it caused upgrade havoc so I think it is at least worth thinking about. In Menu.js, getItemArgs looks like this now:

    Original:
    PHP Code:
        getItemArgs: function(c) {
            var 
    isMenuItem c.isXType(Ext.menu.Item);
            return {
                
    isMenuItemisMenuItem,
                
    needsIcon: !isMenuItem && (c.icon || c.iconCls),
                
    iconc.icon || Ext.BLANK_IMAGE_URL,
                
    iconCls'x-menu-item-icon ' + (c.iconCls || ''),
                
    itemId'x-menu-el-' c.id,
                
    itemCls'x-menu-list-item ' + (this.extraCls || '')
            };
        } 
    As opposed to this:
    Proposed:
    PHP Code:
        getItemArgs: function(c) {
            var 
    isMenuItem instanceof Ext.menu.Item;
            return {
                
    isMenuItemisMenuItem,
                
    needsIcon: !isMenuItem && (c.icon || c.iconCls),
                
    iconc.icon || Ext.BLANK_IMAGE_URL,
                
    iconCls'x-menu-item-icon ' + (c.iconCls || ''),
                
    itemId'x-menu-el-' c.id,
                
    itemCls'x-menu-list-item ' + (this.extraCls || '')
            };
        } 
    The side effect of using isXType is that every subclass must register an xtype or the menus get created all wrong. I prefer the way Ext2 did it, which is the proposed change (use instanceof).

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,989
    Vote Rating
    649
    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


    Changed back for backwards compat.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1