Ext


Go Back   Ext JS Forums > Ext JS Community Forums (2.0) > Ext 2.x: Bugs

Reply
 
Thread Tools
  #1  
Old 10-30-2009, 01:03 PM
OutpostMM OutpostMM is offline
Ext User
 
Join Date: Jan 2008
Posts: 228
OutpostMM is on a distinguished road
Default [2.2.1] Ext.destroy does not remove menu items

Test Case:

<!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.
Reply With Quote
  #2  
Old 10-30-2009, 02:51 PM
tryanDLS tryanDLS is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Posts: 7,375
tryanDLS is on a distinguished road
Default

Have you verified this against 2.3?
__________________
Tim Ryan - Ext JS Support Team
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (3.x | 2.x | 1.x) / FAQ / Wiki / Tutorials / 1.x->2.0 Migration Guide
Reply With Quote
  #3  
Old 10-30-2009, 03:35 PM
OutpostMM OutpostMM is offline
Ext User
 
Join Date: Jan 2008
Posts: 228
OutpostMM is on a distinguished road
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.
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 04:10 PM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.