Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    218
    Vote Rating
    1
    ZooKeeper is on a distinguished road

      0  

    Exclamation doLayout issue in Ext.menu.Menu

    doLayout issue in Ext.menu.Menu


    It worked in ExtJS 4.0.7, but was broken in 4.1.3 and is still broken in 4.2

    PHP Code:
    tb.add({
            
    icon'preview.png',
            
    cls'x-btn-text-icon',
            
    text'Scrolling Menu',
            
    menuscrollMenu
        
    }); 
    to:
    1st test case:

    PHP Code:
       // scrollable menu
        
    var btn tb.add({
            
    icon'preview.png',
            
    cls'x-btn-text-icon',
            
    text'Scrolling Menu',
            
    menuscrollMenu
        
    });
        
    setTimeout(function() {
            
    btn.showMenu();
        }, 
    1000);
        
    setTimeout(function() {
            
    scrollMenu.removeAll();
            
    scrollMenu.add({ text'test item' });
            
    scrollMenu.doLayout();
        }, 
    3000); 
    In this test case you will see full menu after 1 sec. and "detached" item after 3 secs. which will be at top (where first menu item of full menu was)
    2st test case:

    PHP Code:
        // scrollable menu
        
    var btn tb.add({
            
    icon'preview.png',
            
    cls'x-btn-text-icon',
            
    text'Scrolling Menu',
            
    menuscrollMenu
        
    });
        
    setTimeout(function() {
            
    btn.showMenu();
        }, 
    1000);
        
    setTimeout(function() {
            
    scrollMenu.doLayout();
        }, 
    3000); 
    In this test case scrollers will be disappeared

    I think it's some troubles with menu height and shrinkWrap property of its layout.

    First snippet effect:

    2013-03-20_22-37-07.png

    Second snippet effect:

    2013-03-20_22-39-47.jpg

    Supposed to be like this:

    2013-03-20_22-40-53.png

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


    I don't really see a problem here. The menu positions itself when it's triggered by the button. When you add new items and trigger a layout, you're asking the menu to do something independently.

    If you want the menu to reposition, then hide it and show it again.

    Code:
    var btn = tb.add({ 
            icon: 'preview.png', 
            cls: 'x-btn-text-icon', 
            text: 'Scrolling Menu', 
            menu: scrollMenu 
        }); 
        setTimeout(function() { 
            btn.showMenu(); 
        }, 1000); 
        setTimeout(function() { 
            btn.hideMenu();
            scrollMenu.removeAll(); 
            scrollMenu.add({ text: 'test item' });
            btn.showMenu(); 
        }, 3000);
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    218
    Vote Rating
    1
    ZooKeeper is on a distinguished road

      0  

    Default


    It's very slow in long menus. In ExtJS 2 you can easily add and remove items without hiding and showing menu after. You can to do it in 4.0 too. Why can't I to do it in 4.2?

Thread Participants: 1

Tags for this Thread