Not able to obtain the pane

9 posts, 0 answers
  1. unni
    unni avatar
    1 posts
    Member since:
    Apr 2009

    Posted 27 Apr 2009 Link to this post

    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>
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 29 Apr 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 26 May 2010 Link to this post

    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
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 May 2010 Link to this post

    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.
  6. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 01 Jun 2010 Link to this post

    Thanks Dobromir.

    It works.
  7. Alejandro
    Alejandro avatar
    2 posts
    Member since:
    Sep 2010

    Posted 12 Sep 2011 Link to this post

    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
  8. Niko
    Admin
    Niko avatar
    387 posts

    Posted 13 Sep 2011 Link to this post

    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.
  9. Alejandro
    Alejandro avatar
    2 posts
    Member since:
    Sep 2010

    Posted 13 Sep 2011 Link to this post

    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
  10. Niko
    Admin
    Niko avatar
    387 posts

    Posted 14 Sep 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017