RadDock Semitransparent clone

9 posts, 0 answers
  1. Guillermo Sornoza
    Guillermo Sornoza avatar
    6 posts
    Member since:
    Oct 2009

    Posted 27 Mar 2012 Link to this post

    Hi.

    I'm using raddock to let the users to design a dashboard.  I would like to achieve this

    http://jqueryui.com/demos/draggable/#visual-feedback 

    I mean, keep "a copy" of the dock in the dockzone, while i'm dragging it to the target dockzone.

    Is this possible?

    Thanks in advance.

    Guillermo
  2. Guillermo Sornoza
    Guillermo Sornoza avatar
    6 posts
    Member since:
    Oct 2009

    Posted 28 Mar 2012 Link to this post

    Hello?

    Anyone?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 30 Mar 2012 Link to this post

    Hello Guillermo,

    Such a feature is not supported by the RadDock control out-of-the-box. Nevertheless, the dock control exposes a client-side method clone, which is listed in this help article and can be used for creating a temporary copy of the dragged RadDock. You can also find attached a sample project that utilizes this method and could be useful for implementing the desired feature.

    I hope this helps.

    Regards,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Guillermo Sornoza
    Guillermo Sornoza avatar
    6 posts
    Member since:
    Oct 2009

    Posted 02 Apr 2012 Link to this post

    Hi Slav.

    Thanks for you reply.  This is very close to what i'm looking for.  However, when the drag ends, the server event "Dock Position Changed" is not fired.  Any suggestion?

    Thank you so much.
  6. Guillermo Sornoza
    Guillermo Sornoza avatar
    6 posts
    Member since:
    Oct 2009

    Posted 04 Apr 2012 Link to this post

    Something i messed up?
  7. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 05 Apr 2012 Link to this post

    Hello Guillermo,

    The server-side event DockPositionChanged is not fired, because the RadDock, copied via the client-side method clone is dragged and it is not persisted on postback. In order to fire a server-side event when a dock control is dragged, you can use its client event OnClientDockPositionChanged in order to trigger the click event of a hidden ASP button control. After this is done you can handle the Click event of the button in order to implement the desired logic.
    function OnClientDragStart(dock, args) {
        // get a reference to the RadDock HTML element
        var dockElement = dock.get_element();
        //Create a RadDock's clone
        var clonedDock = dock.clone();
     
        var clonedElement = clonedDock.get_element();
     
        //Get the ZoneID from which the dock is initially dragged
        parentToolBoxZoneID = clonedDock.get_dockZoneID();
     
        //Detach the OnClientDragStart handler method from the cloned dock or recursion will occur
        clonedDock.remove_dragStart(OnClientDragStart);
     
        //Attach the OnClientDragEnd handler method to the DragEnd client-side event
        clonedDock.add_dragEnd(OnClientDragEnd);
        clonedDock.add_dockPositionChanged(OnClientDockPositionChanged);
        ....
    }

    function OnClientDockPositionChanged(sender, args) {
        $get("<%=Button1.ClientID %>").click();
    }

    <asp:Button ID="Button1" runat="server" Style="display: none;" onclick="Button1_Click" />

    protected void Button1_Click(object sender, EventArgs e)
    {
        // here you can implement you logic
    }


    All the best,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Guillermo Sornoza
    Guillermo Sornoza avatar
    6 posts
    Member since:
    Oct 2009

    Posted 10 Apr 2012 Link to this post

    Hello Slav.

    I tried your solution but i think it breaks the RadDock Lifecycle.  I mean, i can create the logic in the hidden button click event, but for that moment, the raddocklayout has loaded the docks.  Or am i wrong?

    Regards.
  9. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 12 Apr 2012 Link to this post

    Hello Guillermo,

    It is not a problem to create a RadDock control at a later stage of the page lifecycle, for example Page_Load, you just need to recreate it in Page_Init on the next postback. I would suggest checking this help article as it contains useful information on the matter. The online demo Dock / Dynamically Created Docks will also give you an overview of the approach that should be used in such scenarios.

    Greetings,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  10. Guillermo Sornoza
    Guillermo Sornoza avatar
    6 posts
    Member since:
    Oct 2009

    Posted 16 May 2012 Link to this post

    For all whose are looking for something similar, i solved this by handling the OnClientDragEnd from Dock, then i used AJAX to add the dock data in DB.

    Thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017