RichardFox
asked on
Rendering control in a frame
I have a javascript control (from www.activewidgets.com) that is rendered as follows:
<html>
<head>
<link href="grid.css" type="text/css" rel="stylesheet"> ... from activewidgets
<script src="grid.js"></script> ... from activewidgets
</head>
<body>
<span style="whatever">My Frame Title</span>
<script>
var obj = Active.Controls.Grid;
// ..... set some values, e.g.
obj.setDataProperty("text" , function(i, j){return myArray[i][j]});
document.write(obj);
</script>
</body>
</html>
I use this in an aspx page, browse.aspx. myArray is a javascript array that I create with my server side code (just to give you a little context).
My question is this: I need to put this control into a frame, and limit the frame's size, so that it will always be the same size and there are enough rows the scrollbars will appear. Putting it into a table doesn't work - the control just dissappears. How can I do that?
THanks,
Rich
<html>
<head>
<link href="grid.css" type="text/css" rel="stylesheet"> ... from activewidgets
<script src="grid.js"></script> ... from activewidgets
</head>
<body>
<span style="whatever">My Frame Title</span>
<script>
var obj = Active.Controls.Grid;
// ..... set some values, e.g.
obj.setDataProperty("text"
document.write(obj);
</script>
</body>
</html>
I use this in an aspx page, browse.aspx. myArray is a javascript array that I create with my server side code (just to give you a little context).
My question is this: I need to put this control into a frame, and limit the frame's size, so that it will always be the same size and there are enough rows the scrollbars will appear. Putting it into a table doesn't work - the control just dissappears. How can I do that?
THanks,
Rich
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
here howto:
======================
<script>
function mksize()
{
document.getElementById("m ycontrol") .style.hei ght=docume nt.mycontr ol.documen t.body.scr ollHeight;
}
</script>
<iframe name=mycontrol id=mycontrol onload=mksize(); src=mycontrol.aspx></ifram e>
======================
<script>
function mksize()
{
document.getElementById("m
}
</script>
<iframe name=mycontrol id=mycontrol onload=mksize(); src=mycontrol.aspx></ifram
ASKER
The <iframe> is working fine from a page called browseframe.htm:
<html>
<head>
<LINK href="olstyle.css" rel="stylesheet">
</head>
<body>
<span class="caption"> &nbs p;Browse Investment Event Table </span>
<iframe name="myframe" src="browsetrans.aspx?Comp anyID=All" name="browsetrans" id="browsetrans"
frameborder=no scrolling=no style="width:100%;height=9 0%;border: none;"></i frame>
</body>
</html>
This browseframe.htm is in turn in a frame:
<HTML>
<HEAD>
<TITLE>Closing Binder Inventory</TITLE>
</HEAD>
<frameset COLS="30%,*" FRAMESPACING="3" MARGINWIDTH="0" MARGINHEIGHT="0" RESIZE="NO">
<frame SCROLLING="yes" SRC="inventoryClientSide.a spx" ID="treefrm" NAME="treefrm" RESIZE="YES"
FRAMESPACING="2" FRAMEBORDER="0">
<frameset ROWS="60%,*" FRAMESPACING="2" FRAMEBORDER="1" MARGINWIDTH="0" MARGINHEIGHT="0">
<frame SCROLLING="yes" SRC="addTrans.aspx" ID="addtrans" name="addtrans" FRAMEBORDER="0">
<frame SCROLLING="no" SRC="browseframe.htm" FRAMEBORDER="0" >
</frameset>
</frameset>
</HTML>
The only thing is, when the "browsetrans" iframe is used as a target
string compurl = "http://myserver/DMSInventory/browse.aspx?CompanyID="+compid;
n = new TreeNode();
n.Text = company;
n.Target = "browsetrans";
n.NavigateUrl = compurl;
It doesn't behave itself, the iframe takes over the entire browser window when I click a treenode
<html>
<head>
<LINK href="olstyle.css" rel="stylesheet">
</head>
<body>
<span class="caption"> &nbs
<iframe name="myframe" src="browsetrans.aspx?Comp
frameborder=no scrolling=no style="width:100%;height=9
</body>
</html>
This browseframe.htm is in turn in a frame:
<HTML>
<HEAD>
<TITLE>Closing Binder Inventory</TITLE>
</HEAD>
<frameset COLS="30%,*" FRAMESPACING="3" MARGINWIDTH="0" MARGINHEIGHT="0" RESIZE="NO">
<frame SCROLLING="yes" SRC="inventoryClientSide.a
FRAMESPACING="2" FRAMEBORDER="0">
<frameset ROWS="60%,*" FRAMESPACING="2" FRAMEBORDER="1" MARGINWIDTH="0" MARGINHEIGHT="0">
<frame SCROLLING="yes" SRC="addTrans.aspx" ID="addtrans" name="addtrans" FRAMEBORDER="0">
<frame SCROLLING="no" SRC="browseframe.htm" FRAMEBORDER="0" >
</frameset>
</frameset>
</HTML>
The only thing is, when the "browsetrans" iframe is used as a target
string compurl = "http://myserver/DMSInventory/browse.aspx?CompanyID="+compid;
n = new TreeNode();
n.Text = company;
n.Target = "browsetrans";
n.NavigateUrl = compurl;
It doesn't behave itself, the iframe takes over the entire browser window when I click a treenode
Hi Richard, you have two names happening for your iframe:
<iframe >>name="myframe"<< src="browsetrans.aspx?Comp anyID=All" >>name="browsetrans"<< id="browsetrans" frameborder=no scrolling=no style="width:100%;height=9 0%;border: none;">
Try removing the first name "myframe".
Also, you may have to go with this:
n.Target = top.frames['browsetrans'];
Let me know how it goes.
Regards...
<iframe >>name="myframe"<< src="browsetrans.aspx?Comp
Try removing the first name "myframe".
Also, you may have to go with this:
n.Target = top.frames['browsetrans'];
Let me know how it goes.
Regards...
Also, in your iframe, "height=90%;" should be "height:90%;"
Didn't catch that in my last post, sorry.
Regards...
Didn't catch that in my last post, sorry.
Regards...
<FRAMESET NAME="MAIN" border="1" FRAMESPACING="0" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
<FRAME name="" src="browse.aspx" scrolling="no" border="0" frameborder="no" noresize TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0"></FRAME>
<FRAME name="fraRightFrame" src="test.asp" FRAMEBORDER="no" BORDER="0" BORDERCOLOR="#F1F1F1"></FR
</FRAMESET>
Riyasjef