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

How to disable RadDock in client side?

3 Answers 134 Views
Dock
This is a migrated thread and some comments may be shown as answers.
sabarishbabu
Top achievements
Rank 1
sabarishbabu asked on 11 May 2010, 12:38 PM
Hi,
I would like to disable the RadDock control in client side.  I am using following method to disable the RadDock its working fine in IE,
But it's not working on Google chrome browser. How to resolve this problem? any idea let me know...

function disableDock()  
{  
    var dock = $find("<%= RadDock1.ClientID%>");  
    var outerDiv = dock.get_element();  
    outerDiv.disabled = true;  

Thanks
Sabarish

3 Answers, 1 is accepted

Sort by
0
sabarishbabu
Top achievements
Rank 1
answered on 12 May 2010, 10:55 AM
Hi,
Any update on this post?

Thanks
Sabarish
0
Bob van der Zinch
Top achievements
Rank 2
answered on 12 May 2010, 11:21 AM
How exactly you want to disable it? To disable dragging you can use

dock.set_enableDrag(false); 
0
Pero
Telerik team
answered on 13 May 2010, 03:13 PM
Hi Sabarish,

There is no built-in functionality that will disable the dock on the client-side. However you could make the dock look "disabled", by disabling its movement, and hiding the commands. The following sample project demonstrates how to do this:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
            var enabled = true;
            function DisableDock()
            {
                enabled = !enabled;
                EnableDisableDock(enabled);
 
            }
            function EnableDisableDock(IsEnabled)
            {
                var dock = $find("RadDock1");
                if (IsEnabled)
                {
                    dock.set_enableDrag(true);
                    dock.get_commandsContainer().style.display = "";
                }
                else
                {
                    dock.set_enableDrag(false);
                    dock.get_commandsContainer().style.display = "none";
                }
            }
        </script>
 
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        </Scripts>
    </asp:ScriptManager>
    <input type="button" value="DisableDock" onclick="DisableDock(); return false;" />
    <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">
                    <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
sabarishbabu
Top achievements
Rank 1
Answers by
sabarishbabu
Top achievements
Rank 1
Bob van der Zinch
Top achievements
Rank 2
Pero
Telerik team
Share this question
or