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.