dbadke
2 Feb 2007, 10:44 AM
I am building a site that has a complex layout, with a border layout, a tree panel, multiple tabs in the center region, toolbars, and nested border layouts in the tabs. The layout is working fine (a tribute to Jack's amazing work), except for autoscroll in the content panels and tree panel. I have tried every combiniation of autoScroll and fitToFrame I can think of, and still the panels will not show scrollbars at all, or will show them for the wrong nested element.
So, here's a picture of the interface:
http://tapor.uvic.ca/~dbadke/img/screenshot.jpg
As you (I hope) can see, the tree panel does not have a scrollbar, the center-north panel does, the center-south panel does not. Also, the center-south panel height is less than it should be; you can see white space below where the text is cut off. I have tried turning autoScroll on for various combinations of elements; this either does nothing, or scrolls the toolbars along with the content, or, in the case of the center-south panel, only scrolls within part of the panel. I have tried adding overflow: auto to the HTML elements (that's what is scrolling the center-north panel), but this does not always work.
I guess I just don't understand the nesting of all these static and generated divs. I have looked through the generated source of the page, and everything seems to nest as it should.
Any help would be greatly appreciated!
Here is the HTML:
<div id ="container">
<div id="tTree" class="ylayout-inactive-content">
<div id="tree-tb"></div>
<div id="tree-body" class="treebody"></div>
</div>
<div id="north" class="ylayout-inactive-content">
images/scraps-admin.png
</div>
<div id="tCollection" class="ylayout-inactive-content">
<div id="collectContent" class="ylayout-inactive-content">
<div id="collect-tb"></div>
<div id="collect-body" class="center-body scrollme"></div>
</div>
<div id="collectStatus" class="ylayout-inactive-content"></div>
</div>
<div id="tArtifact" class="ylayout-inactive-content">
<div id="artifactContent" class="ylayout-inactive-content">
<div id="artifact-tb" class="ylayout-inactive-content"></div>
<div id="artifact-body" class="ylayout-inactive-content center-body scrollme"></div>
</div>
<div id="artifactStatus" class="ylayout-inactive-content"></div>
</div>
<div id="tObject" class="ylayout-inactive-content"></div>
<div id="tViewer" class="ylayout-inactive-content"></div>
<div id="tLoad" class="ylayout-inactive-content">
<div id="loadContent" class="ylayout-inactive-content">
<div id="load-tb"></div>
<div id="load-body" class="center-body scrollme"></div>
</div>
<div id="loadStatus" class="ylayout-inactive-content"></div>
</div>
<div id="south" class="ylayout-inactive-content"></div>
</div>
And the Javascript (partial):
init : function(){
layout = new YAHOO.ext.BorderLayout(document.body, {
hideOnLayout: true,
north: {
split:false,
initialSize: 88,
titlebar: false
},
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: true,
collapsible: true,
animate: true,
autoScroll: false
},
south: {
split:true,
initialSize: 100,
minSize: 100,
maxSize: 200,
titlebar: true,
collapsible: true,
animate: true,
autoScroll: true
},
center: {
titlebar: true,
autoScroll: false
}
});
layout.beginUpdate();
layout.add('north', new YAHOO.ext.ContentPanel('north', 'North'));
layout.add('south', new YAHOO.ext.ContentPanel('south', {title: 'South', closable: true}));
var tb = new YAHOO.ext.Toolbar('tree-tb');
... add buttons ...
var treePanel = layout.add('west',
new YAHOO.ext.ContentPanel('tTree',
{title: 'Object Hierarchy',
resizeEl:'tree-body',
toolbar: tb,
autoScroll: true}));
var Tree = YAHOO.ext.tree;
adminTree = new Tree.TreePanel('tree-body',
{animate: true,
loader: new Tree.TreeLoader({dataUrl:'servlets/get-nodes.php'}),
enableDD: false,
containerScroll: true});
adminTreeRoot = new Tree.AsyncTreeNode({text: 'Collections',
draggable:false,
id:'R0'});
adminTree.setRootNode(adminTreeRoot);
adminTree.on('click', this.showTreeClick, this);
var innerLayout = new YAHOO.ext.BorderLayout('tCollection', {
south: {
split:true,
initialSize: 100,
minSize: 50,
maxSize: 400,
autoScroll: false,
collapsible: false,
titlebar: false
},
center: {
autoScroll: false,
titlebar: false
}
});
var tb = new YAHOO.ext.Toolbar('collect-tb');
... add buttons ...
var collectContent = new YAHOO.ext.ContentPanel('collectContent',
{resizeEl:'collect-body',
autoscroll: true,
fitToFrame: true});
innerLayout.add('center', collectContent);
innerLayout.add('south',
new YAHOO.ext.ContentPanel('collectStatus'));
layout.add('center',
new YAHOO.ext.NestedLayoutPanel(innerLayout,
{title: 'Collection',
toolbar: tb,
closable: false}));
var innerLayout = new YAHOO.ext.BorderLayout('tArtifact', {
south: {
split:true,
initialSize: 50,
minSize: 50,
maxSize: 400,
autoScroll:true,
collapsible:false,
titlebar: false
},
center: {
autoScroll:true,
titlebar: false
}
});
... add more nested border layout panels as above ...
layout.getRegion('center').showPanel('tCollection');
layout.getRegion('south').hide();
var tabs = layout.getRegion('center').getTabs();
tabs.disableTab(layout.findPanel('tArtifact').getEl().id);
tabs.disableTab(layout.findPanel('tLoad').getEl().id);
tabs.disableTab(layout.findPanel('tObject').getEl().id);
tabs.disableTab(layout.findPanel('tViewer').getEl().id);
layout.endUpdate();
adminTree.render();
adminTreeRoot.expand();
},
So, here's a picture of the interface:
http://tapor.uvic.ca/~dbadke/img/screenshot.jpg
As you (I hope) can see, the tree panel does not have a scrollbar, the center-north panel does, the center-south panel does not. Also, the center-south panel height is less than it should be; you can see white space below where the text is cut off. I have tried turning autoScroll on for various combinations of elements; this either does nothing, or scrolls the toolbars along with the content, or, in the case of the center-south panel, only scrolls within part of the panel. I have tried adding overflow: auto to the HTML elements (that's what is scrolling the center-north panel), but this does not always work.
I guess I just don't understand the nesting of all these static and generated divs. I have looked through the generated source of the page, and everything seems to nest as it should.
Any help would be greatly appreciated!
Here is the HTML:
<div id ="container">
<div id="tTree" class="ylayout-inactive-content">
<div id="tree-tb"></div>
<div id="tree-body" class="treebody"></div>
</div>
<div id="north" class="ylayout-inactive-content">
images/scraps-admin.png
</div>
<div id="tCollection" class="ylayout-inactive-content">
<div id="collectContent" class="ylayout-inactive-content">
<div id="collect-tb"></div>
<div id="collect-body" class="center-body scrollme"></div>
</div>
<div id="collectStatus" class="ylayout-inactive-content"></div>
</div>
<div id="tArtifact" class="ylayout-inactive-content">
<div id="artifactContent" class="ylayout-inactive-content">
<div id="artifact-tb" class="ylayout-inactive-content"></div>
<div id="artifact-body" class="ylayout-inactive-content center-body scrollme"></div>
</div>
<div id="artifactStatus" class="ylayout-inactive-content"></div>
</div>
<div id="tObject" class="ylayout-inactive-content"></div>
<div id="tViewer" class="ylayout-inactive-content"></div>
<div id="tLoad" class="ylayout-inactive-content">
<div id="loadContent" class="ylayout-inactive-content">
<div id="load-tb"></div>
<div id="load-body" class="center-body scrollme"></div>
</div>
<div id="loadStatus" class="ylayout-inactive-content"></div>
</div>
<div id="south" class="ylayout-inactive-content"></div>
</div>
And the Javascript (partial):
init : function(){
layout = new YAHOO.ext.BorderLayout(document.body, {
hideOnLayout: true,
north: {
split:false,
initialSize: 88,
titlebar: false
},
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: true,
collapsible: true,
animate: true,
autoScroll: false
},
south: {
split:true,
initialSize: 100,
minSize: 100,
maxSize: 200,
titlebar: true,
collapsible: true,
animate: true,
autoScroll: true
},
center: {
titlebar: true,
autoScroll: false
}
});
layout.beginUpdate();
layout.add('north', new YAHOO.ext.ContentPanel('north', 'North'));
layout.add('south', new YAHOO.ext.ContentPanel('south', {title: 'South', closable: true}));
var tb = new YAHOO.ext.Toolbar('tree-tb');
... add buttons ...
var treePanel = layout.add('west',
new YAHOO.ext.ContentPanel('tTree',
{title: 'Object Hierarchy',
resizeEl:'tree-body',
toolbar: tb,
autoScroll: true}));
var Tree = YAHOO.ext.tree;
adminTree = new Tree.TreePanel('tree-body',
{animate: true,
loader: new Tree.TreeLoader({dataUrl:'servlets/get-nodes.php'}),
enableDD: false,
containerScroll: true});
adminTreeRoot = new Tree.AsyncTreeNode({text: 'Collections',
draggable:false,
id:'R0'});
adminTree.setRootNode(adminTreeRoot);
adminTree.on('click', this.showTreeClick, this);
var innerLayout = new YAHOO.ext.BorderLayout('tCollection', {
south: {
split:true,
initialSize: 100,
minSize: 50,
maxSize: 400,
autoScroll: false,
collapsible: false,
titlebar: false
},
center: {
autoScroll: false,
titlebar: false
}
});
var tb = new YAHOO.ext.Toolbar('collect-tb');
... add buttons ...
var collectContent = new YAHOO.ext.ContentPanel('collectContent',
{resizeEl:'collect-body',
autoscroll: true,
fitToFrame: true});
innerLayout.add('center', collectContent);
innerLayout.add('south',
new YAHOO.ext.ContentPanel('collectStatus'));
layout.add('center',
new YAHOO.ext.NestedLayoutPanel(innerLayout,
{title: 'Collection',
toolbar: tb,
closable: false}));
var innerLayout = new YAHOO.ext.BorderLayout('tArtifact', {
south: {
split:true,
initialSize: 50,
minSize: 50,
maxSize: 400,
autoScroll:true,
collapsible:false,
titlebar: false
},
center: {
autoScroll:true,
titlebar: false
}
});
... add more nested border layout panels as above ...
layout.getRegion('center').showPanel('tCollection');
layout.getRegion('south').hide();
var tabs = layout.getRegion('center').getTabs();
tabs.disableTab(layout.findPanel('tArtifact').getEl().id);
tabs.disableTab(layout.findPanel('tLoad').getEl().id);
tabs.disableTab(layout.findPanel('tObject').getEl().id);
tabs.disableTab(layout.findPanel('tViewer').getEl().id);
layout.endUpdate();
adminTree.render();
adminTreeRoot.expand();
},