Client events

3 posts, 1 answers
  1. Steele
    Steele avatar
    96 posts
    Member since:
    Mar 2008

    Posted 01 Sep 2011 Link to this post

    Hi,
    I am having trouble hooking into the client events of the RadSlidingPane. Specifically :

    onclientcollapsed


    Basically, I want to trigger some javascript when the user collapses the sliding pane to hide the contents.
    So I have :
    <telerik:RadSlidingZone ID="rszExtraInfo" runat="server" ClickToOpen="True"
                SlideDirection="Left" SkinID="Vista">
                <telerik:RadSlidingPane ID="RadSlidingPane1" Runat="server"
                    EnableResize="False" onclientexpanding="FetchExtraInfo" Title="More Info"
                    Width="400px" onclientcollapsed="HideExtraInfo">
                    <asp:Panel ID="pnlExtraInfo" runat="server" Height="100%" Width="100%">
                    </asp:Panel>
                </telerik:RadSlidingPane>
            </telerik:RadSlidingZone>
    With my HideExtraInfo declared as :
    function HideExtraInfo(sender) {
        
                        document.getElementById('<%= pnlExtraInfo.ClientID%>').style.display = 'none';
     
                }

    The javascript works well enough, the issue is that the onclientcollapsed event is triggered not only when the pane is collapsed, but also when it is docked.
    Is this by design?
    I have tried to use the accessors of the sender (sliding pane) such as :
    sender.get_collapsed()
    sender.get_docked()
    sender.get_expanded()
    But, no matter what, all of these values return false.
    Is there a way to achieve the outcome I am after?
    Thanks,
    Steele.

    -- Edit : I am using Telerik version 2011.2.712.40
  2. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 05 Sep 2011 Link to this post

    Hi Steele,

     

    I suggest to check for docking, etc with a small timeout, actually timeout of 0 also did the trick on my side:

    <script type="text/javascript">
     
        function HideExtraInfo(sender) {
            setTimeout(function () {
                alert(sender.get_docked());
            }, 0);
        }
     
    </script>


    Please, text my suggestion and let me know how it goes.

    Best wishes,
    Svetlina
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steele
    Steele avatar
    96 posts
    Member since:
    Mar 2008

    Posted 05 Sep 2011 Link to this post

    Yes - thanks, that has worked.
    Steele.
Back to Top