This is a migrated thread and some comments may be shown as answers.

get the window of external pane

8 Answers 207 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Mike McDougall
Top achievements
Rank 1
Mike McDougall asked on 03 Jul 2007, 02:06 PM

I have setup a splitter with an external pane that points to an html page like so:

<telerik:RadPane ID="RadPane2" runat="server" ContentUrl="FullScreenMap.htm"

I can get a client side reference to the pane through by the following:

function GetPane()  
{  
   var splitter = $find("<%= RadSplitter1.ClientID %>");  
   var pane = splitter.getPaneById('RadPane2');         

The problem is that I need to call a javascript function within the external content window.  So I would like to be able to do something like
pane.getWindow.callExternalContenJSFunction(); 

Is there any way to do this?

8 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 03 Jul 2007, 03:10 PM
Hi Mike McDougall,

You can achieve this the following way:
....

pane.getExtContentElement().contentWindow.ShowAlert();

where ShowAlert() is a JavaScript method in the external content window. More information you can find here.

Kind regards,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
ewart
Top achievements
Rank 1
answered on 13 Sep 2007, 10:55 PM
Hi - is this a  "Prometheus" only feature?  I am using the latest version of Q1 2007 but can't find getExtContentElement in the docs and it doesn't seem to work for me on this version.  is there another solution?
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 14 Sep 2007, 09:00 AM
Hi,
You can use the following in the olf radSplitter:
RadSplitter1.GetPaneById('Pane1').GetExtContentContainerElement().contentWindow

0
Jonathan
Top achievements
Rank 1
answered on 20 Sep 2007, 11:30 AM
Hi,

I am having real difficulty trying to get this to work with the Q2 release.

Assuming I have the following splitter defined:

<telerik:RadSplitter ID="MainPaneSplitter" runat="server" Orientation="Horizontal">  
  <telerik:RadPane ID="SelectorPane" runat="server" ContentUrl="Selector.aspx" Height="30px" Width="100%" Scrolling="None">  
    Top Pane  
  </telerik:RadPane> 
  <telerik:RadPane ID="ContentPane" runat="server">                              
  </telerik:RadPane> 
</telerik:RadSplitter> 
 

And assuming I have the 'SelectorPane' pane in my javascript variable as follows (I have checked in the watch window and pane is set):

var iframe = pane.GetExtContentElement();  
var contentWindow = iframe.contentWindow;  
          
 

The first line fails trying to call GetExtContentElement() with 'Object doesnt support this property or method'

I have followed the example to the letter and checked over and over again and can see nothing wrong with my syntax.  Can anyone please offer any help as i'm now completely stuck?
0
Tsvetie
Telerik team
answered on 20 Sep 2007, 12:02 PM
Hi Jonathan,
There are differences in the names of the clientside methods of the old RadSplitter and the Prometheus version. Please check the Changes and backward compatibility topic from our online documentation for a list of the changes. I can see from your code that you are using Prometheus RadSplitter, but a method of the old RadSplitter:
  1. Old RadSplitter: GetExtContentElement
  2. RadSplitter Prometheus: getExtContentElement

Note that the article is about the old RadSplitter, however, the approach described in it applies for both versions of the control.

Greetings,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jonathan
Top achievements
Rank 1
answered on 20 Sep 2007, 12:32 PM
Thanks, but I had already tried both cases, even with lower case I still get the same error.  Here is my javascript code if it is of any help:

var splitter = document.getElementById("<%= MainPaneSplitter.ClientID %>");  
var pane = splitter.getPaneById( "<%= SelectorPane.ClientID %>" );  
var iframe = pane.getExtContentElement();  
var contentWindow = iframe.contentWindow;  
 

I certainly can't see what is wrong!
0
Jonathan
Top achievements
Rank 1
answered on 20 Sep 2007, 12:58 PM
Hmmm, I am rather confused by this.  I have managed to get it to work but only by using the following sytax:

var splitter = $find( "MainPaneSplitter");
var pane = splitter.getPaneById("SelectorPane");
var iframe = pane.getExtContentElement();
var contentWindow = iframe.contentWindow;

It only works for me if I remove the code block and directly put in the ID of the control.  I dont know why this is but at least im up and running now.

0
Tsvetie
Telerik team
answered on 20 Sep 2007, 04:52 PM
Hello Jonathan,
Yes, that is the correct way to get the RadSplitter client object. By using document.getElementById, you will get the HTML element with the specified ID. And in order to use the clientside api of the RadSplitter control, you need to work with the object.

Note that $find should receive the ClientID of the control as well.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Splitter
Asked by
Mike McDougall
Top achievements
Rank 1
Answers by
Petya
Telerik team
ewart
Top achievements
Rank 1
Obi-Wan Kenobi
Top achievements
Rank 1
Jonathan
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or