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

Client events

2 Answers 46 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Steele
Top achievements
Rank 1
Steele asked on 01 Sep 2011, 07:03 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 05 Sep 2011, 03:39 PM
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 >>

0
Steele
Top achievements
Rank 1
answered on 06 Sep 2011, 03:18 AM
Yes - thanks, that has worked.
Steele.
Tags
Splitter
Asked by
Steele
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Steele
Top achievements
Rank 1
Share this question
or