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

Close RadDock after new seconds

1 Answer 32 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Bader
Top achievements
Rank 1
Bader asked on 03 Oct 2010, 07:51 PM
Hi,

I'm wonder if I can hide (close) the raddock after 5 second (for example) of displaying it. In other words, the code must count 5 seconds and then close the raddock (The raddock is displayed immediately after opening the page).

Please, if it is possible, send me the required code,

Regrads,
Bader

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 06 Oct 2010, 05:12 PM
Hello Bader,

The easiest way to achieve this is to use the setTimeout method, when the dock is loaded. Here is an example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="RadScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
        function OnClientInitialize(dock, args)
        {
            setTimeout(function ()
            {
                dock.set_closed(true);
            }, 5000);
        }
    </script>
    <div>
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
            <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px"
                    OnClientInitialize="OnClientInitialize">
                    <ContentTemplate>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        CONTENT
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
    </div>
    </form>
</body>
</html>


Regards,
Pero
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
Tags
Dock
Asked by
Bader
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or