Leon asked:
"I wondered if you know of a way to control the scroll position of the contents in a cfwindow? Do you know if there's some ext api function or property that can be used sort of like the JS scrollIntoView() type function, but applies to the ext window?"
The solution to the problem can be seen in the cfWindowScrollIntoView() function I created below
(click here to see this code working):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CFWindow scrollIntoView()</title>
<script language="JavaScript">
cfWindowScrollIntoView = function(windowName,scrollTo){
Ext.get(scrollTo).scrollIntoView(ColdFusion.Window.getWindowObject(windowName).body.id);
}
</script>
</head>
<body>
<form name="MyForm">
<input type="button" value="auto scroll" onclick="cfWindowScrollIntoView('MyWindow','pToScrollTo');">
</form>
<cfwindow
name="MyWindow"
center="true"
closable="false"
draggable="true"
height="300"
initShow="true"
minHeight="100"
minWidth="200"
modal="false"
refreshOnShow = "false"
resizable="true"
title="My Test Window"
width="400">
click the button to auto scroll to the other section of content in this window
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p id='pToScrollTo'>Congratulations! you found the other content.</p>
</cfwindow>
</body>
</html>
BTW, I used to run the Southern California CF User Group. I'm glad to see someone else has finally taken up the reins in the OC area. I'll look into your meetings and try to attend one soon.
change the javascript to be like this:
<script language="JavaScript">
cfWindowScrollIntoView = function(windowName,scrollTo){
win=ColdFusion.Window.getWindowObject(windowName);
el=Ext.get(scrollTo);
el.scrollIntoView(win.body.id);
win.body.scroll('down',el.getTop()-win.body.getTop(),false);
}
</script>
http://www.coldfusionguy.com/ColdFusion/Samples/cf...
I have a problem with the ext window and I dont know how I resolve this.
How put a ext window inside a cfform tag?
Example:
Called the page window.cfm
<ext:window id="settings" title="..:: Window ::.." width="500" height="200" iconCls="settings" modal="true" resizable="true" closeAction="hide" source="http://localhost:8500/window.cfm">
How I call the ext window in a cfform tag in the event onSubmit?
This code:
This form post variables to a page.cfc
<cfform action="page.cfc?Method=Package" method="post" name="XMLl" onsubmit="window.open('','pop_up','width=400,height=290,left=250,top=250,screenX=350,screenY=-150');" target="pop_up">
How change the onsubmit=window.open to ext window.
Can you help me?
Tks
Hugs from Brazil.
Fabiano Magno Pechibella