I have an Accordion in ExtJS and I want to add new Panels to it dynamically. The Panels need to be collapsed when they appear. The code that I have now will create the Panels, but the HTML in each panel won't show.
var loadoutput = new Ext.Panel({
title: 'Log',
renderTo: 'logout',
layout: 'accordion',
defaults: {
bodyStyle: 'padding:10px',
collapsed: true
},
layoutConfig: {
fill: true,
animate: true
}
});
function logOutput(_title, _html) {
temp = new Ext.Panel();
temp.title = _title;
temp.html = _html;
temp.collapsed = true;
loadoutput.items.add(temp);
loadoutput.doLayout();
}
logOutput("Well, that was interesting", "Dude, what's up? <br/>Hey hey hey<br/>AAAAAH.");
logOutput("Hello", "Dude, what's up? <br/>Hey hey hey<br/>AAAAAH.");
logOutput("What?", "Dude, what's up? <br/>Hey hey hey<br/>AAAAAH.");
logOutput("Cat", "Dude, what's up? <br/>Hey hey hey<br/>AAAAAH.");