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

Expand/Collapse with Double click

4 Answers 132 Views
Dock
This is a migrated thread and some comments may be shown as answers.
ajit
Top achievements
Rank 1
ajit asked on 29 Jul 2009, 03:19 PM
Hi,
         Please could you provide me with a way of expanding the rad dock with a double click. It is an urgent need in my project.

Thank you

Regards,
Ajit

4 Answers, 1 is accepted

Sort by
0
Vyrban
Top achievements
Rank 1
answered on 31 Jul 2009, 09:20 AM
Hi ajit ,

I got an example that behavior of the dock is near to the normal browser window: double click on the titlebar expand/collapse the dock.
Hope it can helps you. Here is the code:
<body> 
<script type="text/javascript"
    function toggle(titleBarContent) { 
        var dock = titleBarContent.offsetParent.offsetParent.control; 
        if(dock.get_collapsed()) 
            dock.set_collapsed(false) 
        else 
            dock.set_collapsed(true) 
    } 
 
</script> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager> 
    <div> 
        <telerik:RadDock ID="RadDock1" runat="server"
        <TitlebarTemplate> 
        <div ondblclick="toggle(this)"
            Title 
        </div> 
        </TitlebarTemplate> 
        <ContentTemplate> 
        Dock Content 
        </ContentTemplate> 
        </telerik:RadDock> 
    </div> 
    </form> 
</body> 

0
ajit
Top achievements
Rank 1
answered on 31 Jul 2009, 02:14 PM
Hi Vyrban,
                 Thank you for your reply. Actually i am generating the docks dynamically so i am not sure whether supplying a div tag would work in my case. So is there a way i can supply this functionality dynamically.

Thank you,

Regards,
Ajit
0
Mr. Plinko
Top achievements
Rank 1
answered on 31 Jul 2009, 02:35 PM
I have this functionality and used this Double Click RadDock Collapse thread to help me out.

to do this in JavaScript. The sample code is

<html xmlns="http://www.w3.org/1999/xhtml" >  
<head runat="server">   
    <title>Untitled Page</title>  
</head>  
<body>  
    <form id="form1" runat="server">   
        <asp:scriptmanager id="ScriptManager1" runat="server">   
        </asp:scriptmanager>  
        <telerik:RadDock ID="RadDock1" runat="server" text="Test" onclientinitialize="OnClientInitialize">        
        </telerik:RadDock>     
        <script type="text/javascript">                  
        function OnClientInitialize(sender, args)      
        {      
            $addHandlers(sender._handle, {"dblclick": myHandler}, sender);      
        }      
              
        function myHandler()      
        {      
            var isCollapsed = !this.get_collapsed();       
            this.set_collapsed(isCollapsed);       
            this.updateClientState();      
        }      
        </script>     
    </form>  
</body>  
</html>  


0
ajit
Top achievements
Rank 1
answered on 31 Jul 2009, 02:58 PM
Hello Mr. Plinko ,
                             Thank you very much, it did solve my problem. Appreciate all your help.

Regards,
Ajit
Tags
Dock
Asked by
ajit
Top achievements
Rank 1
Answers by
Vyrban
Top achievements
Rank 1
ajit
Top achievements
Rank 1
Mr. Plinko
Top achievements
Rank 1
Share this question
or