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

How to loop through the existing RadDock's in a RadDockLayout and dispose of them client side

3 Answers 114 Views
Dock
This is a migrated thread and some comments may be shown as answers.
hkdave95
Top achievements
Rank 2
hkdave95 asked on 11 Jul 2008, 06:49 AM
Hi

I have a requirement whereby I need to loop through all Docks in a DockLayout and dispose of them client side.

Can you help me with some code that does this ?

Kind Regards

David

3 Answers, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 11 Jul 2008, 08:07 AM
Hi,

RadDockLayout does not provide client-side functionality. You can go through all RadDockZones on the page and using the client-side method get_docks which they provide to take the docks in each of them.
The other option is to handle the OnClientInitialize event of the RadDock and register each of the docks in a collection which you can use afterwards, e.g:
<script type="text/javascript">  
var docks = [];  
function registerDock(dock)  
{  
    if (!Array.contains(docks, dock))  
        Array.add(docks, dock);  
}  
</script> 
<telerik:raddock id="dock1" runat="server" onclientinitialize="registerDock"></telerik:raddock> 
However, the docks are rendered server-side and it is not possible to dispose them on the client.

Kind regards,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rubicon Computer Systems
Top achievements
Rank 1
answered on 11 Jul 2008, 08:32 AM
Hi

Thanks for your swift reply.

This will almost work.

However, server side I have a problem whereby when I try and recreate my Docks after moving them around the screen, I get an error saying I cannot add the dock again.

I am clearing my RadDocLayout Controls before re-adding, however it still says that the Dock already exists on the page.

This error only seems to occur after I have moved the RadDock on the page.

I do not use RadDockZones so all my RadDocks are floating.

Kind Regards

David
0
Sophy
Telerik team
answered on 11 Jul 2008, 10:34 AM
Hi Rubicon,

The problem you experience is most probably due to recreating docks having the same ids as those of already existing docks on the page. Do you use Ajax to partially update the page? Could you please open a support ticket and attach a simple running page which reproduces issue you describe so that we can take a closer look at your code and investigate the problem?
We will be glad to help you solve the issue.

Kind regards,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
hkdave95
Top achievements
Rank 2
Answers by
Sophy
Telerik team
Rubicon Computer Systems
Top achievements
Rank 1
Share this question
or