PDA

View Full Version : [OPEN-808] Toolbar buttons in overflow donīt get destroyed



defcon1
31 Mar 2010, 5:30 AM
Hi,

I have a toolbar to which buttons are added dynamically. The toolbar has option 'enableOverflow'. The handler of the button destroys itself and removes it from the toolbar. This doesnīt work if you click on the button which is in the overflow-dropdown.

Regards
d1



<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<link rel="stylesheet" type="text/css" href="../libraries/ext-3.2-rc/resources/css/ext-all.css">

<script type="text/javascript" src="../libraries/ext-3.2-rc/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../libraries/ext-3.2-rc/ext-all-debug.js"></script>


<script type="text/javascript">

Ext.onReady(function() {

// Define tab-panel
var tabpanel = new Ext.Panel({

renderTo: document.body,
width: 800,
height: 600,
title: "Search Results",
border: true,
enableTabScroll: true,
tbar: new Ext.Toolbar({

enableOverflow: true,
items: [
{
text: 'Add Button',
handler: function() {

var button = new Ext.Button({

text: 'IAMAVERYLONGANDUSELESSTITLE',
handler: function(b, eventobject) {

b.setVisible(false);
b.destroy();

tabpanel.getTopToolbar().doLayout();
}
});

tabpanel.getTopToolbar().add (button);
tabpanel.getTopToolbar().doLayout();
}
}
]
})
});
});

</script>

</head>

<body>

</body>
</html>