No completely working example given

2 posts, 0 answers
  1. Perry
    Perry avatar
    19 posts
    Member since:
    Jan 2008

    Posted 17 Nov 2010 Link to this post

    Hi,

    There doesn't seem to be one fully working barebones demo of confirming a dock close. All of the examples given are for previous versions showing work arounds for bugs that hopefully don't exist anymore or have contrivances in them that make them unusable.

    I want to dynamically add a dock. I want to be able to reorder the docks. I want them to display a confirmation before closing.

    I have tried every combination of the multiple examples given. The best I could do is displaying the confirmation but the dock had already closed.

    This is a major problem with Telerik. There is no authoritative source of barebones examples. The site is polluted with old versions of examples that don't work anymore. There should be a single comprehensive list of examples organized by library version. This library should be indexed and it should be searchable. The need for this is manifested by the frequency with which people ask the same questions over and over again. It isn't because they didn't try to find the answer themselves - I have spent three hours on this so far. It is because there are multiple conflicting inconsistant examples.

    And examples should be barebone. They should show one concept and contain only the minimal set of code that demonstrates the concept. Telerik examples are bloated and confusing because of this.
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 23 Nov 2010 Link to this post

    Hi Perry,

    You're right. Examples showing how to implement certain scenarios with the RadDock control are missing. We have some in our Code Library, but sample showing how to confirm closing of RadDock is not available.
    For your convenience I have created such project, and here is its full source code:

    <!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">
            function OnClientCommand(dock, args)
            {
                if (args.command.get_name() == "CustomClose" && window.confirm('Close dock?'))
                {
                    dock.set_closed(true);
                }
            }
        </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"
                        OnClientCommand="OnClientCommand">
                        <Commands>
                            <telerik:DockCommand CssClass="rdClose" Text="Close" Name="CustomClose" />
                            <telerik:DockExpandCollapseCommand />
                        </Commands>
                        <ContentTemplate>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eu leo quis felis eleifend
                            congue id ac nulla. Suspendisse in sapien eu tortor aliquam luctus. Suspendisse
                            pretium, nulla sit amet porttitor lobortis, ante sapien blandit ante, et tempor
                            magna eros nec sapien. In hac habitasse platea dictumst. Nullam a quam lorem, eu
                            vestibulum turpis. Praesent a neque et diam tincidunt suscipit ut semper massa.
                            Vivamus posuere, mi eu consectetur consequat, libero risus accumsan erat, ut facilisis
                            dolor justo a enim. Donec suscipit tincidunt lorem, sed aliquam velit pulvinar euismod.
                            Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
                            mus.
                        </ContentTemplate>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </telerik:RadDockLayout>
        </div>
        </form>
    </body>
    </html>

    We will upload the code into our Code Library as soon as we can.

    Kind regards,
    Pero
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top