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

RadDock Semitransparent clone

8 Answers 60 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Guillermo Sornoza
Top achievements
Rank 1
Guillermo Sornoza asked on 27 Mar 2012, 11:16 PM
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

8 Answers, 1 is accepted

Sort by
0
Guillermo Sornoza
Top achievements
Rank 1
answered on 29 Mar 2012, 12:40 AM
Hello?

Anyone?
0
Slav
Telerik team
answered on 30 Mar 2012, 02:09 PM
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.
0
Guillermo Sornoza
Top achievements
Rank 1
answered on 02 Apr 2012, 08:06 PM
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.
0
Guillermo Sornoza
Top achievements
Rank 1
answered on 04 Apr 2012, 08:41 PM
Something i messed up?
0
Slav
Telerik team
answered on 05 Apr 2012, 12:18 PM
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.
0
Guillermo Sornoza
Top achievements
Rank 1
answered on 10 Apr 2012, 09:51 PM
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.
0
Slav
Telerik team
answered on 12 Apr 2012, 04:37 PM
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.
0
Guillermo Sornoza
Top achievements
Rank 1
answered on 16 May 2012, 06:27 PM
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!
Tags
Dock
Asked by
Guillermo Sornoza
Top achievements
Rank 1
Answers by
Guillermo Sornoza
Top achievements
Rank 1
Slav
Telerik team
Share this question
or