extjs: make tree scroll properly when in a ContentPanel with toolbar

HTML

<div id="tree_container">
   <div id="tree_toolbar"></div>
   <div id="tree_panel"></div>
</div>

Javascript

function createContentPanel() {
    // ... code to create TreePanel on 'tree_panel'
 
    var tbTree = new Ext.Toolbar('tree_toolbar');
 
    // ... code to add toolbar buttons
 
    return new Ext.ContentPanel('pnltags', {
        title: 'Tree Example',
        toolbar: tbTree,
        fitToFrame: true,
        resizeEl: 'tree_panel',
        autoScroll: true
    });
};
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License