1. #1
    Sencha User
    Join Date
    Jan 2008
    Posts
    240
    Vote Rating
    0
    OutpostMM is on a distinguished road

      0  

    Default [2.2.1] Ext.destroy does not remove menu items

    [2.2.1] Ext.destroy does not remove menu items


    Test Case:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
      <head>
        <title>Menu Item Bug</title>
        <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css">
      </head>
      <body>
        <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="ext/ext-all-debug.js"></script>
        
        <script type="text/javascript">
        Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif";
        Ext.namespace("Bugtest");
    
        Bugtest.test = function()
        {
          return (
          {
            init: function()
            {
              var new_win = new Ext.Window({
                title: 'Bug Test',
                width: 200,
                height: 200,
                tbar: [
                  {
                    text: 'Test Menu',
                    menu: {
                      items: [
                        {
                          text: 'Item 1',
                          handler: function() { alert('item 1'); }
                        },
                        {
                          text: 'Item 2',
                          handler: function() { alert('item 2'); }
                        },
                        {
                          text: 'Item 3',
                          handler: function() { alert('item 3'); }
                        },
                        {
                          text: 'Delete This',
                          id: 'item_to_destroy',
                          handler: function() { alert('this will not appear'); }
                        }
                      ]
                    }
                  }
                ],
              });
    
              new_win.show();
    
              // this will remove the listener, but not remove the component
              Ext.destroy(Ext.getCmp('item_to_destroy'));
            }
          });
        }
        </script>
    
        <script type="text/javascript">
        var t = new Bugtest.test();
        t.init.call(t);
        </script>
      </body>
    </html>
    Expected behavior:

    The fourth item on the menu should be removed from the menu.

    Actual behavior:

    The fourth item on the menu appears, but the listener is removed.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Have you verified this against 2.3?

  3. #3
    Sencha User
    Join Date
    Jan 2008
    Posts
    240
    Vote Rating
    0
    OutpostMM is on a distinguished road

      0  

    Default


    No I haven't had a chance to download 2.3 yet, I'll try to do that this afternoon and see what happens.

Thread Participants: 1