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

Accessing Panes

1 Answer 35 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
David Beck
Top achievements
Rank 1
David Beck asked on 12 May 2010, 05:36 PM
Hello i am trying to execute this sample code but keep getting an error

<input type="button" value="LEFT PANE" onclick="LoadExternalContent('http://www.google.com','RightPane');" /> 
         
<script type="text/javascript" language="javascript">  
            function LoadExternalContent(url, targetPaneID) {  
                //obtain reference to the parent page             
                //var splitterPageWnd = window.parent;  
                //call a method from the parent page-->  
                var splitterObject = GetMainSplitter();  
                var splitter = $find("MainSplitter");  
                alert(splitterObject);  
                var _pane = splitter.GetPaneByID("LeftPane");  
                var pane = splitterObject.GetPaneById("LeftPane");  
                if (!pane) return;  
                pane.set_contentUrl(url);  
            }  
 
        </script> 

I get an Error stating that Splitter doesnt have the property GetPaneById

Any Ideas?

1 Answer, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 14 May 2010, 07:08 AM
Hi Loren Dorez,

You should use GetPaneById instead GetPaneByID method.
for example:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <script type="text/javascript">
        function LoadExternalContent(url)
        {
            var splitter = $find("<%=RadSplitter1.ClientID %>");
            var pane = splitter.GetPaneById("RadPane3");
            pane.set_contentUrl(url);
        }   
    </script>
    <div>
    <input type="button" value="SetURL" onclick="LoadExternalContent('http://www.google.com')" />
    <telerik:RadSplitter ID="RadSplitter1" runat="server">
        <telerik:RadPane ID="RadPane1" runat="server"  Width="22">
            <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" Width="22" ClickToOpen="true">
                <telerik:RadSlidingPane ID="RadSlidingPane1" Title="RadSlidingPane1" runat="server" Width="190" MinWidth="120">
                </telerik:RadSlidingPane>
            </telerik:RadSlidingZone>
        </telerik:RadPane>
        <telerik:RadPane ID="RadPane2" runat="server"></telerik:RadPane>
        <telerik:RadSplitBar ID="RadSplitBar1" runat="server"></telerik:RadSplitBar>
        <telerik:RadPane ID="RadPane3" runat="server"></telerik:RadPane>
    </telerik:RadSplitter>
    </div>
    </form>
</body>
</html>
Let us know if you have any other questions.

All the best,
Petio Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Splitter
Asked by
David Beck
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Share this question
or