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

can't access pane by getPaneById

1 Answer 110 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
xie yufei
Top achievements
Rank 1
xie yufei asked on 02 Apr 2011, 06:38 PM

Dear,

I want to access a pane and set it's content url.it works by using

var contentPane = $find("<%= PaneRight.ClientID %>");
and not works by using
var splitter = GetRadSplitter();
var pane = splitter.getPaneById("PaneRight");

the page source below
<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Base.Master" AutoEventWireup="true"
    CodeBehind="RptAuth.aspx.cs" Inherits="Rp.UI.ReportManager.RptAuth" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
  
    <script type="text/javascript" language="javascript">
        function GetRadSplitter() {
            return $find("<%= RadSplitter1.ClientID %>");
        }
  
        function tvClientNodeClicked(sender, eventArgs) {
            var node = eventArgs.get_node();
            if (node.get_nodes().get_count() > 0) {
                return;
            }
//            var splitter = GetRadSplitter();
//            var pane = splitter.getPaneById("<%= PaneRight.ClientID %>");
//            debugger;
            var contentPane = $find("<%= PaneRight.ClientID %>");
            if (!contentPane) return;
  
                 }
    </script>
  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Vertical" BorderSize="0"
        BorderStyle="None" Height="100%" Width="100%">
        <telerik:RadPane ID="PaneLeft" runat="server" Scrolling="None" Height="100%" Width="180px">
            <div style="border-top-style: solid; border-top-width: 1px; border-top-color: #3333CC">
                <telerik:RadTreeView ID="tvUser" Height="100%" Width="100%" runat="server" OnClientNodeClicked="tvClientNodeClicked">
                    <Nodes>
                                   </div>
        </telerik:RadPane>
        <telerik:RadSplitBar runat="server" ID="RadSplitBar1" CollapseMode="Forward" />
        <telerik:RadPane ID="PaneRight" runat="server" Scrolling="Both">
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>

I noticed that all the demo have used the second way to access the specified pane.how to fix my code?

thanks

Kevin

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 04 Apr 2011, 11:57 AM
Hi Kevin,

In order to get reference to a RadPane using RadSplitter's getPaneById() client-side method, you need to provide the clientId of the pane. Please note that the ContentPlaceHolders are naming containers and the clientId of the controls inside are modified, thus you need to pass the RadPane's clientId to the method, e.g.:
var splitter = GetRadSplitter();
var pane = splitter.getPaneById("<%=PaneRight.ClientID %>");


Greetings,
Dobromir
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
xie yufei
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or