Hi folks. I've been battling with a problem for a while. I
want to use CFLAYOUT tags within CFWINDOW. Now, this works just
fine and dandy, except that CFLAYOUT does not know the size of the
CFWINDOW.
Thus, if you use CFLAYOUT wihthin a CFWINDOW, you are likely
getting scroll borders for the window. I can manually set the
CFLAYOUT size with the style attribute for sure to get rid of the
problem, but static sized windows aren't really cool...
How could I make the CFLAYOUT automatically resize according
to the CFWINDOW size? I've tried to use the
ColdFusion.Window.getWindowObject() but I haven't been able to
succesfully touch the ExtJs's basicElement object properties...
Here's some code samples to start with. Hope it doesn't have
too many typos, since I altered the code somewhat before posting...
index.cfm :
<script>
function destroyWindow(name) {
ColdFusion.Window.destroy(name);
}
function resizeWindow(name,width,height){
alert(width+' '+height);
// name is an object. Now what? How do I extract the object
name or Id .. and
// how to dig out the correct id's, the style of which I
want to change...?
}
function newTestManager() {
i = Math.random();
ColdFusion.Window.create('testManager'+i,'Test
Manager','testmanager.cfm',{width:800,height:500})
ColdFusion.Window.onHide('testManager'+i, destroyWindow);
win = ColdFusion.Window.getWindowObject('testManager'+i);
win.on('resize',resizeWindow);
}
</script>
<a href="javascript:newTestManager()"
id="newTestManager">Test Manager</a>
--
testmanager.cfm:
<cflayout type="border"
style="height:470px;width:786px">
<cflayoutarea splitter="true" size="190" minsize="100"
maxsize="400" name="tmleft" position="left"
source="testmanager.left.cfm">
</cflayoutarea>
<cflayoutarea position="center" name="tmcenter"
source="testmanager.center.cfm">
</cflayoutarea>
</cflayout>
--
create testmanager.left.cfm and testmanager.center.cfm -
might be empty files as well.
Try leaving out the cflayout style attribute, and see what
happens if you omit that. You might also try to open a smaller
CFWINDOW if the problem doesn't highlight otherwise.
I'm sure many others would appreciate a solution to this.
Thanks!