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

Adding zones and docks purely through client-side script?

3 Answers 97 Views
Dock
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 08 Apr 2008, 07:32 PM
Hi all.  I've been looking through the Dynamic Docks example and was wondering whether there were a way to add docks and zones exclusively through client-side script?

What I'm ultimately trying to do (and trying to decide if we can leverage the RadDock and zone controls for this) is to have a series of docks on the screen in a single zone, with each dock acting as a container for a zone and other docks... in this case, the container docks are Categories and the child docks are Items within those categories.  The items should be sortable within a category, and draggable to other categories.  The categories themselves should be sortable as well.

I have a simple example with some pre-defined category and item docks working as a proof-of-concept to show that we could have nested docks this way.  But I would then need to allow a user the ability client-side to create new categories and items as well.  Can we mimic a $create(Telerik.Web.UI.RadDoc...) call within a client button's onclick event or otherwise create the new docks/zones from javascript?

3 Answers, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 12 Apr 2008, 10:12 AM
RadDock couldn't be created on the client with JavaScript, because it has a Server side rendering.
The only one way to create the RadDock is with (Postback/Ajax call)

You can add RadDockZone into a RadDock.
Also you can use the RadDockZone.dock() method to rearange RaDDocks on the client. You can find more about it here:
http://www.telerik.com/help/radcontrols/prometheus/?dock_ClientRadDockZone.html
0
mike
Top achievements
Rank 1
answered on 18 Apr 2008, 08:50 PM
Hi Obi-Wan.  I appreciate your reply.  I was able in fact to get a purely client-side creation functionality working.  You are correct in the rendering issue; if the creation is happening through ajax, the server-side control rendering can apply.  In my code I had to render the visual appearance of docks client-side in addition to calling $create(...) for the dock object itself.  I am essentially mimicking the server-side control rendering via the DOM. 

0
Stephen Austin
Top achievements
Rank 1
answered on 11 Sep 2009, 06:03 PM
Can you post any info on how you were able to accomplish this?

Thanks!
Tags
Dock
Asked by
mike
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
mike
Top achievements
Rank 1
Stephen Austin
Top achievements
Rank 1
Share this question
or