Copy link to clipboard
Copied
Whenever you load a tab dynamically with a cflayoutarea (tab) in Coldfusion 9 it won't get the height right (usually just does like 20px high). This will also happen when trying to reload a tab with coldfusion.navigate. I need to figure out how to access the underlying EXT or use coldfusion functions to get these tabs to redraw. As of now my only workaround is assigning a height to it, but that will create scrollbars instead of just correctly fitting the height as it should. Below is a example layoutarea:
<cflayout type="tab" style="padding:5px; width:940px;" name="ajaxTabs">
<cflayoutarea name="tab0" selected="#tab0#" style="padding:5px; min-height:450px;" overflow="auto" refreshonactivate="yes"
title="<p id='n1'>Saved Newsletters</p>"
source="#myself##xfa.savedNewsletters#" />
I've gotten the formula to get the layoutarea to react but haven't figured out exactly what I need to get it to resize (Below is just an attempt to jump start the height by disabling/enabling):
<cfsavecontent variable="theJS">
<script type="text/javascript">
function resizeTab() {
var activeID = ColdFusion.Layout.getTabLayout('ajaxTabs').getActiveTab().id;
ColdFusion.Layout.disableTab('ajaxTabs', activeID);
ColdFusion.Layout.enableTab('ajaxTabs', activeID);
ColdFusion.Layout.selectTab('ajaxTabs', activeID);
return;
}
</script>
</cfsavecontent>
<cfhtmlhead text="#theJS#">
<cfset ajaxOnLoad('resizeTab')>
1 Correct answer
Right, I have fixed it, I cannot guarantee that other cfajax functions wont be affected, but my tests so far show everything is ok.
Basically I started taking a look through the CF Javascript files, and found the one that has all the CF functions which control the ExtJS functions.
After a bit of playing about, and then some whooping to the dismay of my colleagues, I managed to get the autoHeight working.
What I found is the the Coldfusion code first creates a Tabpanel, but puts nothing in it, the
...Copy link to clipboard
Copied
This worked for me,
cflayout.js file
change _1c.style.height=_1b;
to _1c.height=_1b;
Copy link to clipboard
Copied
If you don't have a problem hardcoding the layout area height, then this solution works both in CF9 in CF11:
<cflayout style="">
<cflayoutarea style="overflow-y:scroll; height: 450px;">


-
- 1
- 2