if (panel.getData("collapseBtn") != null) {
Component tool = (Component) panel.getData("collapseBtn");
tool.removeAllListeners();
panel.getHeader().removeTool(tool);
}
panel.removeListener(Events.BeforeCollapse, collapseListener);
panel.removeListener(Events.BeforeExpand, collapseListener);
}
component.setData("init", null);
component.setData("collapseBtn", null);
component.setData("collapse", null);