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

Not able to obtain the pane

8 Answers 158 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
unni
Top achievements
Rank 1
unni asked on 27 Apr 2009, 10:15 AM
am using assembly RadSplitter.Net2

The method 
splitter.GetPaneById('EndPane')
throws error as object doesnt support this property or method...
This is where am calling the method...OnClientLoaded="CollapsePane()".
code is
function CollapsePane()
{
var splitter = "<%= RadSplitter1.ClientID %>";
var pane = splitter.GetPaneById('EndPane');
}

The following is the pane code
 <radspl:RadSplitter ID="RadSplitter1" runat="server" Height="100%" LiveResize="true" OnClientLoaded="CollapsePane()"
                        ResizeWithBrowserWindow="true" Width="100%" Skin="Outlook" BorderSize="0" BorderStyle="None">
 <radspl:RadPane ID="EndPane" runat="server" Scrolling="none" Width="22" MinWidth="22"
                            Visible="false">
                            <radspl:RadSlidingZone ID="Radslidingzone1" runat="server" Width="22"  SlideDirection="Left"
                                ClickToOpen="false">
                                <radspl:RadSlidingPane ID="Radslidingpane5" Title="Sections" runat="server" Width="150"
                                    TabView="TextAndImage" IconUrl="../assets/favorites.gif" >
                                    <div id="radSecSub">
                                    <table class="right_navigation" id="tblRightPane" runat="server">
                                    </table>
                                    </div>
                                </radspl:RadSlidingPane>
                            </radspl:RadSlidingZone>
                        </radspl:RadPane>
                    </radspl:RadSplitter>

8 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 29 Apr 2009, 11:23 AM
Hello Unni,

The code you provided is correct but I already saw your other thread which contains more information and I answered it - for your convenience I pasted my reply below:

As far as I can see from your code the RadPane is correctly referenced but you want to collapse it by using the collapse() method. Please, note that this method is part of the client - side API of the RadSplitter for ASP.NET AJAX and the method in your case should be written with a capital C as Collapse. Since javascript is case sensitive, it cannot find a collapse method and that is why you get the error. In order to fix it you should modify the code in the following manner:

function CollapsePane(sender,args)    {       var splitter = "<%= RadSplitter1.ClientID %>";  
       var slidingPane = splitter.GetPaneById('<%=EndPane.ClientID %>');  
       alert(slidingPane);       if (slidingPane)       {           slidingPane.Collapse();       }       else       {           alert( "Pane with ID '" + paneId + "' not found.");       }    } 

Note, also that this is a RadPane and not a RadSlidingPane. You can see the API reference of the RadSplitter for ASP.NET and the mentioned method below:

http://www.telerik.com/help/aspnet/splitter/radpane%20client%20object.html

An online demo which shows a programmatic collapse of a RadPane is available below:

http://demos.telerik.com/aspnet-classic/Splitter/Examples/ClientSideAPI/DefaultCS.aspx

Regards,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 26 May 2010, 11:30 AM
Hi,

How do I address the SlidingPane for Expand() in the following structure?

 <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%" VisibleDuringInit="false"
           <telerik:RadPane ID="LeftPane" runat="server" Width="22px" Scrolling="none"
                <telerik:RadSlidingZone ID="SlidingZone1" runat="server" Width="22px"
                    <telerik:RadSlidingPane ID="RadSlidingPane1" Title="OPEN" runat="server" Width="180px"
I keep getting "object doesnt support this property or method..." messages all the time.

Regards,
Marc
0
Dobromir
Telerik team
answered on 28 May 2010, 02:50 PM
Hi Mark,

RadSlidingPane does not have client-side method called expand(). In order to programmatically expand a sliding pane you need to use its parent sliding zone client method expandPane("PaneID"), e.g.:
function doSomething()
{
    var slidingPane = $find("<%= RadSlidingPane1.ClientID %>");
    var slidingZone = $find("<%= RadSlidingZone1.ClientID %>");
    if (slidingPane.get_expanded())
        slidingZone.collapsePane(slidingPane.get_id());
    else
        slidingZone.expandPane(slidingPane.get_id());
}


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.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 01 Jun 2010, 12:23 PM
Thanks Dobromir.

It works.
0
Alejandro
Top achievements
Rank 1
answered on 12 Sep 2011, 05:23 PM
Hi,
I'm having troubles to get the client objects in several ways, for instance I configured the event "OnClientLoaded" for the splitter and trying to access the "eventArgs.splitterObj" but that variable is undefined when I run it.

I have also tried to get it in the following way:
function OnSplitterLoadHandler(sender, eventArgs) {
//alert(eventArgs.splitterObj.ID);
var splitter = <%= RadSplitter1.ClientID %>;
var pane = splitter.GetPaneById("rpnDoc");
}

But I get a Javascript error saying "Object doesn't support property or method GetPaneById".

Here is my splitter definition:
<telerik:RadSplitter ID="RadSplitter1" Runat="server" SplitBarsSize=""
        Height="100%" Width="100%"   FullScreenMode="False" LiveResize="true" OnClientLoaded="OnSplitterLoadHandler">

It seems to me like a general error in the client side API but I can't figure out the reason, the splitter is actually working on the page, I can't just use the API. please advice.

Regards
0
Niko
Telerik team
answered on 13 Sep 2011, 03:20 PM
Hi Alejandro,

As a starting point I would suggest that you review the following help article.
Notice that the id of the splitter alone as a name is not a JavaScript object. For that you need to have it as a string and sent as a parameter to the $find method so that you can get a reference to the splitter control:
var splitter = $find("<%= RadSplitter1.ClientID %>");
However there is an easier way if that JavaScript method is a splitter event handler. If that is the case, then the sender parameter itself is a reference to the splitter and you do not need to use the $find method.
var splitter = sender;


Hope this makes sense.

Greetings,
Niko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Alejandro
Top achievements
Rank 1
answered on 13 Sep 2011, 05:16 PM
Thanks Niko,

Both solutions worked, I tried something like this before and I think it didn't work because I was trying it on a script on the HEAD section and probably before the initialization of all the client side objects. Do you have any tip regarding when is appropriate to call this functions? Like after the onload event or something like that?

Best Regards
0
Niko
Telerik team
answered on 14 Sep 2011, 10:45 AM
Hi Alejandro,

The controls' client objects are created at the page_load client event. Therefore a best practice is to use the $find method at that event or any time after it.

Hope this helps.

Kind regards,
Niko
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Splitter
Asked by
unni
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Dobromir
Telerik team
Alejandro
Top achievements
Rank 1
Niko
Telerik team
Share this question
or