Solved

Rendering control in a frame

Posted on 2004-09-08
6
349 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:RichardFox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Expert Comment

by:riyasjef
ID: 12009385
try this

<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"></FRAME>
</FRAMESET>

Riyasjef
0
 
LVL 14

Accepted Solution

by:
ziffgone earned 500 total points
ID: 12009567
Or simply:

<iframe name="myframe" src="browse.aspx" framborder="no" align="center" style="width:400px;height:200px;border:none;"></iframe>

Adjust the "width" and "height" to suit your needs.

Hope that helps.

Regards...
0
 
LVL 25

Expert Comment

by:devic
ID: 12009666
here howto:
======================
<script>
function mksize()
{
      document.getElementById("mycontrol").style.height=document.mycontrol.document.body.scrollHeight;
}
</script>
<iframe name=mycontrol id=mycontrol onload=mksize(); src=mycontrol.aspx></iframe>
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:RichardFox
ID: 12009979
The <iframe> is working fine from a page called browseframe.htm:

<html>
<head>
      <LINK href="olstyle.css" rel="stylesheet">
</head>
<body>
      <span class="caption">&nbsp;&nbsp;Browse Investment Event Table&nbsp;&nbsp;</span>
      <iframe name="myframe" src="browsetrans.aspx?CompanyID=All" name="browsetrans" id="browsetrans"
            frameborder=no scrolling=no style="width:100%;height=90%;border:none;"></iframe>
</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.aspx" 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
0
 
LVL 14

Expert Comment

by:ziffgone
ID: 12011358
Hi Richard, you have two names happening for your iframe:

<iframe     >>name="myframe"<<    src="browsetrans.aspx?CompanyID=All"   >>name="browsetrans"<<   id="browsetrans" frameborder=no scrolling=no style="width:100%;height=90%;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...
0
 
LVL 14

Expert Comment

by:ziffgone
ID: 12011387
Also, in your iframe, "height=90%;" should be "height:90%;"

Didn't catch that in my last post, sorry.

Regards...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP: Filling Out/Creating a PDF 29 109
links not working 2 27
arrays and radio buttons 10 40
JQuery - Default innerhtml text with keyup function (copy as you type) 3 17
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question