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

RadDock myportal example ugly DOM

1 Answer 47 Views
Dock
This is a migrated thread and some comments may be shown as answers.
jose luis
Top achievements
Rank 1
jose luis asked on 26 Aug 2011, 02:03 AM
hi i have been studying this example of dynamic raddock with usercontrols.
What i found is that after you play almost 30 seconds creating and closing docks the html Dom is a complete dissaster, full of divs left by the raddock windows.

there is a way to clean this dom, for example using a server side event for the close command to unload the control and have a clean DOM?
i found a little bit complicated because there should be only one close event function for all raddocks so posible you should pass the control loaded in any way to this event handler to know which control you should unload, and in that case i have not clear that could be keep clean.

Thanks a lot.

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 31 Aug 2011, 01:05 PM
Hello Jose,

The described behavior is examined because in the My Portal online demo a hidden UpdatePanel is used in order to help with saving state when minimizing, moving and closing docks. As a result the docking zones are not updated and the HTML elements of the RadDocks are persisted on the page.

If you want to clear the remaining divs, you can utilize only one UpdatePanel, wrapping the RadDockZones, and attach the AsyncPostBackTriggers in the code-behind to this update panel. This way the empty elements, left by the RadDocks, will be cleared when the docks are closed. In order to achieve this, also a new Ajax request will have to be send, for example you can add a new dock, because when a RadDock is closed, its Closed property is set to true, but on Page.Init the old ViewState is preserved and the RadDock is recreated.

I hope the provided solution helps. Don't hesitate to contact us again should you encounter more difficulties.

Regards,
Slav
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Dock
Asked by
jose luis
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or